const { data } = await clinik.intakes.submit({
patientId: 'pt_abc123',
encounterId: 'enc_xyz789',
questionnaire: 'https://forms.clinikapi.com/new-patient-intake',
status: 'completed',
basedOn: ['sr_referral123'],
items: [
{
linkId: 'chief-complaint',
text: 'What is your primary reason for visiting today?',
answer: [{ valueString: 'Annual physical exam' }],
},
{
linkId: 'allergies',
text: 'Do you have any known allergies?',
answer: [{ valueBoolean: true }],
},
{
linkId: 'pain-level',
text: 'Rate your current pain level (0-10)',
answer: [{ valueInteger: 3 }],
},
{
linkId: 'temperature',
text: 'Body temperature',
answer: [{ valueQuantity: { value: 98.6, unit: '°F' } }],
},
{
linkId: 'smoking-status',
text: 'Smoking status',
answer: [{
valueCoding: {
system: 'http://snomed.info/sct',
code: '266919005',
display: 'Never smoker',
},
}],
},
{
linkId: 'vitals-group',
text: 'Vitals',
items: [
{
linkId: 'weight',
text: 'Weight',
answer: [{ valueQuantity: { value: 165, unit: 'lbs' } }],
},
{
linkId: 'height',
text: 'Height',
answer: [{ valueString: '5\'10"' }],
},
],
},
],
});