{
  "openapi": "3.0.3",
  "info": {
    "title": "IMMZ.C4.Create client record API",
    "description": "Data elements for the IMMZ.C4.Create client record Data Dictionary Activity.  Identical to IMMZ.C5.3.Update client details.",
    "version": "1.0.0"
  },
  "paths": {
    "/StructureDefinition-IMMZ_C4_Create_client_record.schema.json": {
      "get": {
        "summary": "JSON Schema definition for the Logical Model StructureDefinition-IMMZ_C4_Create_client_record",
        "description": "This endpoint serves the JSON Schema definition for the Logical Model StructureDefinition-IMMZ_C4_Create_client_record.",
        "responses": {
          "200": {
            "description": "The JSON Schema for StructureDefinition-IMMZ_C4_Create_client_record",
            "content": {
              "application/schema+json": {
                "schema": {
                  "$ref": "./StructureDefinition-IMMZ_C4_Create_client_record.schema.json"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StructureDefinition-IMMZ_C4_Create_client_record": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$id": "http://smart.who.int/base/StructureDefinition-IMMZ_C4_Create_client_record.schema.json",
        "title": "IMMZ.C4.Create client record",
        "description": "Data elements for the IMMZ.C4.Create client record Data Dictionary Activity.  Identical to IMMZ.C5.3.Update client details.",
        "type": "object",
        "properties": {
          "resourceType": {
            "type": "string",
            "const": "IMMZC4",
            "description": "Resource type identifier for IMMZ_C4_Create_client_record logical model"
          },
          "@context": {
            "description": "JSON-LD context for this logical model with ValueSet vocabularies",
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "description": "URI reference to external JSON-LD context"
              },
              {
                "type": "object",
                "description": "Inline JSON-LD context",
                "properties": {
                  "@version": {
                    "type": "number",
                    "const": 1.1
                  },
                  "fhir": {
                    "type": "string",
                    "const": "http://hl7.org/fhir/"
                  }
                },
                "additionalProperties": {
                  "type": "string",
                  "format": "uri"
                }
              },
              {
                "type": "array",
                "description": "Array of JSON-LD context objects/URIs",
                "items": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "object"
                    }
                  ]
                }
              }
            ]
          },
          "@type": {
            "type": "string",
            "description": "JSON-LD type identifier for IMMZ_C4_Create_client_record logical model",
            "examples": [
              "LogicalModel-IMMZ_C4_Create_client_record"
            ]
          },
          "IMMZC4": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "FHIR "
            },
            "description": "Data elements for the IMMZ.C4.Create client record Data Dictionary Activity.  Identical to IMMZ.C5.3.Update client details."
          },
          "uniqueIdentifier": {
            "type": "string",
            "description": "Unique identifier for the client, according to the policies applicable to each country. There can be more than one unique identifier used to link records (e.g. national identification [ID], health ID, immunization information system ID, medical record ID)"
          },
          "name": {
            "type": "string",
            "description": "The full name of the client"
          },
          "firstName": {
            "type": "string",
            "description": "Client's first name or given name"
          },
          "familyName": {
            "type": "string",
            "description": "Client's family name or last name"
          },
          "sex": {
            "oneOf": [
              {
                "type": "string",
                "description": "Code from ValueSet IMMZ.C.DE5 (plain string)"
              },
              {
                "type": "object",
                "description": "Code from ValueSet IMMZ.C.DE5 (JSON-LD structure)",
                "properties": {
                  "@type": {
                    "type": "string",
                    "const": "http://smart.who.int/base/ValueSet-IMMZ.C.DE5.jsonld",
                    "description": "JSON-LD type reference to ValueSet IMMZ.C.DE5"
                  },
                  "@id": {
                    "type": "string",
                    "format": "uri",
                    "description": "Full IRI of the code from ValueSet IMMZ.C.DE5"
                  }
                },
                "required": [
                  "@type",
                  "@id"
                ],
                "additionalProperties": false
              }
            ],
            "description": "Documentation of a specific instance of sex information for the client"
          },
          "dateOfBirth": {
            "type": "string",
            "description": "Client's date of birth (DOB) if known; if unknown, use assigned DOB for administrative purposes"
          },
          "age": {
            "type": "string",
            "description": "The client's calculated age (presented as number of years, months, weeks, days) based on the DOB and the visit date"
          },
          "caregiversMultiple": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "FHIR BackboneElement"
            },
            "description": "Details of the client's caregiver (person) who could be next of kin (e.g. partner, husband, mother, sibling, etc.)"
          },
          "id": {
            "type": "object",
            "description": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."
          },
          "modifierExtension": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "FHIR Extension"
            },
            "description": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself)."
          },
          "caregiversFullName": {
            "type": "string",
            "description": "The full name of the client's caregiver"
          },
          "caregiversFirstName": {
            "type": "string",
            "description": "First or given name of the client's caregiver"
          },
          "caregiversFamilyName": {
            "type": "string",
            "description": "Family name or last name of the client's caregiver"
          },
          "contactPhoneNumber": {
            "type": "string",
            "description": "Client's phone number; can be a landline or a mobile phone number"
          },
          "address": {
            "type": "string",
            "description": "Client's home address or address that the client is consenting to disclose"
          }
        },
        "required": [
          "resourceType",
          "uniqueIdentifier",
          "name",
          "sex",
          "dateOfBirth",
          "contactPhoneNumber",
          "address"
        ],
        "resourceDefinition": "http://smart.who.int/immunizations/StructureDefinition/IMMZC4",
        "fhir:parent": "http://hl7.org/fhir/StructureDefinition/Base",
        "jsonld:valuesets": [
          "IMMZ.C.DE5"
        ],
        "jsonld:contextTemplate": {
          "@version": 1.1,
          "fhir": "http://hl7.org/fhir/",
          "IMMZ.C.DE5": "http://smart.who.int/base/ValueSet-IMMZ.C.DE5.jsonld"
        }
      }
    }
  }
}