const { data: doc } = await clinik.documents.create({
status: 'final',
type: 'discharge-summary',
patientId: 'pt_abc123',
encounterId: 'enc_xyz789',
practitionerId: 'prac_def456',
title: 'Discharge Summary - Jane Doe - Jan 15, 2025',
date: '2025-01-15',
confidentiality: 'N',
sections: [
{
title: 'Chief Complaint',
code: 'chief-complaint',
text: 'Patient admitted for evaluation of acute chest pain.',
},
{
title: 'History of Present Illness',
code: 'hpi',
text:
'Patient is a 55-year-old female presenting with substernal chest pain '
+ 'radiating to the left arm, onset 3 hours prior to admission. '
+ 'Associated with diaphoresis and shortness of breath.',
},
{
title: 'Hospital Course',
code: 'hospital-course',
text:
'Troponin levels negative x3. ECG showed no ST changes. '
+ 'Stress test negative for ischemia. Cardiac catheterization not indicated. '
+ 'Pain attributed to musculoskeletal cause.',
},
{
title: 'Discharge Medications',
code: 'medications',
text:
'Continue aspirin 81mg daily, atorvastatin 20mg daily. '
+ 'New: naproxen 500mg twice daily as needed for chest wall pain.',
resourceIds: ['rx_aspirin', 'rx_statin', 'rx_naproxen'],
},
{
title: 'Discharge Instructions',
code: 'instructions',
text:
'Return to ER if chest pain recurs, worsens, or is associated with '
+ 'shortness of breath, dizziness, or syncope. '
+ 'Follow up with PCP in 1 week. Cardiology follow-up in 4 weeks.',
},
{
title: 'Follow-up',
code: 'follow-up',
text: 'PCP: 1 week. Cardiology: 4 weeks. Repeat lipid panel in 3 months.',
},
],
});