Charting
Learn how to implement clinical charting workflows using FHIR resources in Medict.
Overview
Clinical charting involves documenting patient encounters, observations, and clinical notes. Medict provides FHIR-compliant resources to support comprehensive charting workflows.
Core Charting Resources
Encounters
Encounters represent patient visits or interactions with healthcare providers.
// Create a new encounter
const encounter = await client.createResource({
resourceType: 'Encounter',
status: 'finished',
class: {
system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode',
code: 'AMB',
display: 'ambulatory'
},
type: [{
coding: [{
system: 'http://www.ama-assn.org/go/cpt',
code: '99213',
display: 'Office or other outpatient visit'
}]
}],
subject: {
reference: 'Patient/patient-id'
},
participant: [{
individual: {
reference: 'Practitioner/practitioner-id'
}
}],
period: {
start: '2023-01-15T10:00:00Z',
end: '2023-01-15T10:30:00Z'
},
reasonCode: [{
coding: [{
system: 'http://snomed.info/sct',
code: '185349003',
display: 'Cough'
}]
}]
});
Clinical Notes
Document clinical findings and assessments using Composition resources.
// Create a clinical note
const clinicalNote = await client.createResource({
resourceType: 'Composition',
status: 'final',
type: {
coding: [{
system: 'http://loinc.org',
code: '11488-4',
display: 'Consult note'
}]
},
subject: {
reference: 'Patient/patient-id'
},
encounter: {
reference: 'Encounter/encounter-id'
},
author: [{
reference: 'Practitioner/practitioner-id'
}],
title: 'Office Visit - January 15, 2023',
section: [{
title: 'Chief Complaint',
text: {
status: 'generated',
div: '<div>Patient presents with cough and fever</div>'
}
}, {
title: 'History of Present Illness',
text: {
status: 'generated',
div: '<div>Patient reports 3-day history of productive cough with yellow sputum...</div>'
}
}, {
title: 'Assessment and Plan',
text: {
status: 'generated',
div: '<div>1. Upper respiratory infection<br/>2. Prescribe antibiotics<br/>3. Follow up in 1 week</div>'
}
}]
});
Vital Signs Charting
Recording Vital Signs
async function recordVitalSigns(patientId, encounterId, vitalSigns) {
const vitalSignsObservation = await client.createResource({
resourceType: 'Observation',
status: 'final',
category: [{
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/observation-category',
code: 'vital-signs'
}]
}],
code: {
coding: [{
system: 'http://loinc.org',
code: '85354-9',
display: 'Vital signs panel'
}]
},
subject: {
reference: `Patient/${patientId}`
},
encounter: {
reference: `Encounter/${encounterId}`
},
effectiveDateTime: new Date().toISOString(),
component: [
{
code: {
coding: [{
system: 'http://loinc.org',
code: '8480-6',
display: 'Systolic blood pressure'
}]
},
valueQuantity: {
value: vitalSigns.systolic,
unit: 'mmHg'
}
},
{
code: {
coding: [{
system: 'http://loinc.org',
code: '8462-4',
display: 'Diastolic blood pressure'
}]
},
valueQuantity: {
value: vitalSigns.diastolic,
unit: 'mmHg'
}
},
{
code: {
coding: [{
system: 'http://loinc.org',
code: '8310-5',
display: 'Body temperature'
}]
},
valueQuantity: {
value: vitalSigns.temperature,
unit: '°F'
}
},
{
code: {
coding: [{
system: 'http://loinc.org',
code: '8867-4',
display: 'Heart rate'
}]
},
valueQuantity: {
value: vitalSigns.heartRate,
unit: '/min'
}
}
]
});
return vitalSignsObservation;
}
Retrieving Vital Signs
async function getVitalSigns(patientId, encounterId) {
const vitalSigns = await client.searchResources('Observation', {
patient: `Patient/${patientId}`,
encounter: `Encounter/${encounterId}`,
category: 'vital-signs'
});
return vitalSigns;
}
Problem List Management
Adding Problems
async function addProblem(patientId, encounterId, problem) {
const condition = await client.createResource({
resourceType: 'Condition',
clinicalStatus: {
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/condition-clinical',
code: 'active'
}]
},
verificationStatus: {
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/condition-ver-status',
code: 'confirmed'
}]
},
category: [{
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/condition-category',
code: 'encounter-diagnosis'
}]
}],
code: {
coding: [{
system: problem.codeSystem,
code: problem.code,
display: problem.display
}]
},
subject: {
reference: `Patient/${patientId}`
},
encounter: {
reference: `Encounter/${encounterId}`
},
onsetDateTime: problem.onsetDate,
recordedDate: new Date().toISOString()
});
return condition;
}
Retrieving Problem List
async function getProblemList(patientId) {
const problems = await client.searchResources('Condition', {
patient: `Patient/${patientId}`,
clinical-status: 'active'
});
return problems;
}
Medication Management
Prescribing Medications
async function prescribeMedication(patientId, encounterId, medication) {
const medicationRequest = await client.createResource({
resourceType: 'MedicationRequest',
status: 'active',
intent: 'order',
medicationCodeableConcept: {
coding: [{
system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
code: medication.rxnormCode,
display: medication.name
}]
},
subject: {
reference: `Patient/${patientId}`
},
encounter: {
reference: `Encounter/${encounterId}`
},
authoredOn: new Date().toISOString(),
requester: {
reference: 'Practitioner/practitioner-id'
},
dosageInstruction: [{
text: medication.instructions,
timing: {
repeat: {
frequency: medication.frequency,
period: medication.period,
periodUnit: medication.periodUnit
}
},
doseAndRate: [{
doseQuantity: {
value: medication.dose,
unit: medication.doseUnit
}
}]
}]
});
return medicationRequest;
}
Medication History
async function getMedicationHistory(patientId) {
const medications = await client.searchResources('MedicationRequest', {
patient: `Patient/${patientId}`,
status: 'active'
});
return medications;
}
Lab Results
Recording Lab Results
async function recordLabResult(patientId, encounterId, labResult) {
const observation = await client.createResource({
resourceType: 'Observation',
status: 'final',
category: [{
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/observation-category',
code: 'laboratory'
}]
}],
code: {
coding: [{
system: 'http://loinc.org',
code: labResult.loincCode,
display: labResult.testName
}]
},
subject: {
reference: `Patient/${patientId}`
},
encounter: {
reference: `Encounter/${encounterId}`
},
effectiveDateTime: labResult.collectionDate,
valueQuantity: {
value: labResult.value,
unit: labResult.unit
},
referenceRange: [{
low: {
value: labResult.normalLow,
unit: labResult.unit
},
high: {
value: labResult.normalHigh,
unit: labResult.unit
}
}],
interpretation: [{
coding: [{
system: 'http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation',
code: labResult.interpretation
}]
}]
});
return observation;
}
Charting Workflow Example
Here's a complete example of a charting workflow:
async function completeChartingWorkflow(patientId, chartingData) {
// 1. Create encounter
const encounter = await client.createResource({
resourceType: 'Encounter',
status: 'finished',
class: { code: 'AMB' },
subject: { reference: `Patient/${patientId}` },
period: {
start: chartingData.startTime,
end: chartingData.endTime
}
});
// 2. Record vital signs
if (chartingData.vitalSigns) {
await recordVitalSigns(patientId, encounter.id, chartingData.vitalSigns);
}
// 3. Add problems
if (chartingData.problems) {
for (const problem of chartingData.problems) {
await addProblem(patientId, encounter.id, problem);
}
}
// 4. Prescribe medications
if (chartingData.medications) {
for (const medication of chartingData.medications) {
await prescribeMedication(patientId, encounter.id, medication);
}
}
// 5. Record lab results
if (chartingData.labResults) {
for (const labResult of chartingData.labResults) {
await recordLabResult(patientId, encounter.id, labResult);
}
}
// 6. Create clinical note
const clinicalNote = await client.createResource({
resourceType: 'Composition',
status: 'final',
type: { coding: [{ code: '11488-4' }] },
subject: { reference: `Patient/${patientId}` },
encounter: { reference: `Encounter/${encounter.id}` },
title: `Office Visit - ${new Date().toLocaleDateString()}`,
section: chartingData.noteSections
});
return {
encounter,
clinicalNote
};
}
Best Practices
1. Use Standard Codes
Always use standard coding systems (LOINC, SNOMED CT, RxNorm) for better interoperability.
2. Include Context
Link observations and notes to specific encounters for better organization.
3. Validate Data
Ensure all required fields are populated and data types are correct.
4. Handle Errors
Implement proper error handling for failed charting operations.
5. Audit Trail
Maintain proper audit trails for all charting activities.
Next Steps
- Learn about Questionnaires & Assessments
- Explore Care Planning
- Understand Medications
- Review Labs & Imaging