Medplum · Arazzo Workflow

Medplum Register Patient With Observation

Version 1.0.0

Create a Patient, then record a vital-sign Observation that references that patient.

1 workflow 1 source API 1 provider
View Spec View on GitHub HealthcareFHIROpen SourceDeveloper PlatformHIPAASMART on FHIRClinicalInteroperabilityArazzoWorkflows

Provider

medplum

Workflows

register-patient-with-observation
Create a Patient and an Observation that references it.
Creates a Patient resource, reads back the assigned id, creates a vital-sign Observation referencing Patient/{id}, and confirms the Observation by reading it.
3 steps inputs: birthDate, familyName, givenName, observationCode, observationDisplay, observationUnit, observationValue outputs: observationId, observationStatus, patientId
1
createPatient
createResource
Create a FHIR Patient resource with the supplied name and birth date. Medplum returns the persisted resource including the server assigned id.
2
createObservation
createResource
Create an Observation whose subject references the patient created in the previous step.
3
confirmObservation
readResource
Read the newly created Observation back by id to confirm it persisted and to capture its current status.

Source API Descriptions

Arazzo Workflow Specification

medplum-register-patient-with-observation-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Medplum Register Patient With Observation
  summary: Create a Patient, then record a vital-sign Observation that references that patient.
  description: >-
    A foundational clinical onboarding flow. The workflow creates a FHIR Patient
    resource, captures the generated patient id from the create response, and
    then creates an Observation whose subject reference points back at the new
    patient. Finally it reads the Observation back to confirm it persisted.
    Every step spells out its FHIR request inline so the flow can be read and
    executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: medplumApi
  url: ../openapi/medplum-openapi-original.yml
  type: openapi
workflows:
- workflowId: register-patient-with-observation
  summary: Create a Patient and an Observation that references it.
  description: >-
    Creates a Patient resource, reads back the assigned id, creates a vital-sign
    Observation referencing Patient/{id}, and confirms the Observation by reading
    it.
  inputs:
    type: object
    required:
    - familyName
    - givenName
    - observationCode
    - observationDisplay
    - observationValue
    - observationUnit
    properties:
      familyName:
        type: string
        description: The patient's family (last) name.
      givenName:
        type: string
        description: The patient's given (first) name.
      birthDate:
        type: string
        description: The patient's date of birth in YYYY-MM-DD form.
      observationCode:
        type: string
        description: The LOINC code for the observation (e.g. 8867-4 heart rate).
      observationDisplay:
        type: string
        description: Human readable display for the observation code.
      observationValue:
        type: number
        description: The numeric measured value of the observation.
      observationUnit:
        type: string
        description: The UCUM unit of the measured value (e.g. /min).
  steps:
  - stepId: createPatient
    description: >-
      Create a FHIR Patient resource with the supplied name and birth date.
      Medplum returns the persisted resource including the server assigned id.
    operationId: createResource
    parameters:
    - name: resourceType
      in: path
      value: Patient
    requestBody:
      contentType: application/fhir+json
      payload:
        resourceType: Patient
        name:
        - family: $inputs.familyName
          given:
          - $inputs.givenName
        birthDate: $inputs.birthDate
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      patientId: $response.body#/id
  - stepId: createObservation
    description: >-
      Create an Observation whose subject references the patient created in the
      previous step.
    operationId: createResource
    parameters:
    - name: resourceType
      in: path
      value: Observation
    requestBody:
      contentType: application/fhir+json
      payload:
        resourceType: Observation
        status: final
        code:
          coding:
          - system: http://loinc.org
            code: $inputs.observationCode
            display: $inputs.observationDisplay
        subject:
          reference: "Patient/$steps.createPatient.outputs.patientId"
        valueQuantity:
          value: $inputs.observationValue
          unit: $inputs.observationUnit
          system: http://unitsofmeasure.org
          code: $inputs.observationUnit
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      observationId: $response.body#/id
  - stepId: confirmObservation
    description: >-
      Read the newly created Observation back by id to confirm it persisted and
      to capture its current status.
    operationId: readResource
    parameters:
    - name: resourceType
      in: path
      value: Observation
    - name: id
      in: path
      value: $steps.createObservation.outputs.observationId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      observationStatus: $response.body#/status
      subjectReference: $response.body#/subject/reference
  outputs:
    patientId: $steps.createPatient.outputs.patientId
    observationId: $steps.createObservation.outputs.observationId
    observationStatus: $steps.confirmObservation.outputs.observationStatus