const { data: intake } = await clinik.intakes.submit({
patientId: 'pt_abc123',
encounterId: 'enc_xyz789',
questionnaire: 'https://forms.clinikapi.com/new-patient-intake',
status: 'completed',
items: [
{
linkId: 'chief-complaint',
text: 'Primary reason for visit',
answer: [{ valueString: 'Persistent headaches for 2 weeks' }],
},
{
linkId: 'allergies',
text: 'Known allergies',
answer: [
{ valueString: 'Penicillin' },
{ valueString: 'Sulfa drugs' },
],
},
{
linkId: 'current-medications',
text: 'Current medications',
answer: [
{ valueString: 'Lisinopril 10mg daily' },
{ valueString: 'Metformin 500mg twice daily' },
],
},
{
linkId: 'pain-level',
text: 'Current pain level (0-10)',
answer: [{ valueInteger: 6 }],
},
{
linkId: 'smoking-status',
text: 'Smoking status',
answer: [{
valueCoding: {
system: 'http://snomed.info/sct',
code: '8517006',
display: 'Former smoker',
},
}],
},
],
});