On A&P-merged templates, the Core API can return Assessment & Plan as structured subsections: one per clinical problem, each with a stable id. Use those IDs to attach ICD-10 codes per problem and to export the note problem-by-problem into an EHR.
When structured A&P is returnedโ
Structured subsections appear when the note uses an A&P-merged template (keys ending in _AP_MERGED, for example GENERIC_SOAP_AP_MERGED). Custom organization templates with a merged Assessment & Plan section qualify too.
Discover templates and sections for the authoritative list available to your organization.
Read the generated noteโ
Every section carries a required content union: TEXT or SUBSECTIONS.
Text sections (default, including A&P on non-merged templates):
{
"key": "HISTORY_OF_PRESENT_ILLNESS",
"title": "History of present illness",
"content": {
"type": "TEXT",
"text": "The patient reports..."
}
}
Structured Assessment & Plan (A&P-merged templates only):
{
"key": "ASSESSMENT_AND_PLAN",
"title": "Assessment & Plan",
"content": {
"type": "SUBSECTIONS",
"subsections": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Hypertension",
"text": "Continue lisinopril 10 mg daily."
},
{
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"title": "Type 2 diabetes",
"text": "Maintain metformin; recheck A1c in 3 months."
}
]
}
}
A single note mixes both variants: A&P uses SUBSECTIONS; all other sections use TEXT.
Note request bodies accept content.type: "TEXT" or content.type: "SUBSECTIONS" on the Assessment & Plan section. To receive subsection_id on normalized conditions, the input note must use content.type: "SUBSECTIONS" with stable subsections[].id values; do not send content.type: "TEXT" when generation returned SUBSECTIONS.
Generate ICD-10 codes by subsectionโ
Paths below use the Server API; User API equivalents exist at /v1/core/user/... with the same shapes.
- Generate or edit the note (
POST /v1/core/server/generate-noteorPOST /v1/core/server/edit-note-with-instructions). - Call
POST /v1/core/server/generate-normalized-datawith the full note. Preserve subsectionidvalues on the A&P section when you resend the note:
{
"note": {
"locale": "ENGLISH_US",
"template_key": "GENERIC_MULTIPLE_SECTIONS_AP_MERGED",
"sections": [
{
"key": "ASSESSMENT_AND_PLAN",
"title": "Assessment & Plan",
"content": {
"type": "SUBSECTIONS",
"subsections": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Hypertension",
"text": "Continue lisinopril 10 mg daily."
},
{
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"title": "Type 2 diabetes",
"text": "Maintain metformin; recheck A1c in 3 months."
}
]
}
}
]
}
}
Each returned condition includes subsection_id: a UUID matching one content.subsections[].id from the input note's A&P section when the condition is tied to structured A&P, or null otherwise:
{
"conditions": [
{
"coding": {
"system": "http://hl7.org/fhir/sid/icd-10-cm",
"code": "I10",
"display": "Essential (primary) hypertension"
},
"categories": ["ENCOUNTER_DIAGNOSIS"],
"subsection_id": "550e8400-e29b-41d4-a716-446655440000"
},
{
"coding": {
"system": "http://hl7.org/fhir/sid/icd-10-cm",
"code": "E11.9",
"display": "Type 2 diabetes mellitus without complications"
},
"categories": ["ENCOUNTER_DIAGNOSIS"],
"subsection_id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
]
}
- One
conditionis one code; a subsection may appear on multiple conditions. subsection_idisnullwhen the condition is not tied to a subsection (for example problem-list items).
Preserve subsection IDsโ
When editing a note before normalization or export, round-trip SUBSECTIONS verbatim so id values stay stable. POST /v1/core/server/edit-note-with-instructions accepts the same content union on each section.
Async responses and webhooksโ
POST /v1/core/server/generate-note-async poll responses use the X-Nabla-Api-Version header on the poll request. They follow the same content union as synchronous endpoints.
Webhook payloads (generate_note_async.succeeded, generate_normalized_data_async.succeeded) use your organization's pinned API version, not the version header on the original async POST. Until you upgrade the pinned version, webhook note sections keep the legacy { key, title, text } shape even if you call /next endpoints.
Normalized codes are not included in note generation responses. Call POST /v1/core/server/generate-normalized-data (or the async variant) after you have the final note.
See Setup Webhooks for delivery details.
Validationโ
content.type: "SUBSECTIONS"on a non-A&P section returns400 BAD_REQUEST.
See Note customization for how split_by_problem differs from structured subsections.