{
  "resourceType": "StructureDefinition",
  "id": "profile-patient-sg-nric",
  "url": "https://fhir.synapxe.sg/StructureDefinition/profile-patient-sg-nric",
  "version": "1.0.0",
  "name": "SGPatientNRICProfile",
  "title": "Singapore Patient Profile with NRIC",
  "status": "draft",
  "date": "2026-05-25",
  "publisher": "Synapxe",
  "description": "A FHIR Patient profile for Singapore healthcare context requiring NRIC (National Registration Identity Card) as the primary identifier. This profile enforces Singapore NRIC format validation and mandates specific identifier fields.",
  "purpose": "To standardize patient identification in Singapore healthcare systems using NRIC as the primary identifier, ensuring data quality and interoperability across healthcare institutions.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "short": "Singapore Patient with NRIC",
        "definition": "Patient resource profiled for Singapore healthcare context with mandatory NRIC identifier."
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "pattern",
              "path": "system"
            }
          ],
          "rules": "open",
          "ordered": false,
          "description": "Slice based on identifier system to distinguish NRIC from other identifier types"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:nric",
        "path": "Patient.identifier",
        "sliceName": "nric",
        "short": "Singapore NRIC",
        "definition": "Singapore National Registration Identity Card number. Must follow the format: S/T/F/G/M + 7 digits + checksum letter.",
        "min": 1,
        "max": "1",
        "patternIdentifier": {
          "system": "https://fhir.synapxe.sg/NamingSystem/nric"
        },
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:nric.use",
        "path": "Patient.identifier.use",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Patient.identifier:nric.type",
        "path": "Patient.identifier.type",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Patient.identifier:nric.system",
        "path": "Patient.identifier.system",
        "short": "NRIC identifier system",
        "definition": "Fixed URI for Singapore NRIC identification system",
        "min": 1,
        "max": "1",
        "fixedUri": "https://fhir.synapxe.sg/NamingSystem/nric",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:nric.value",
        "path": "Patient.identifier.value",
        "short": "NRIC number",
        "definition": "The actual NRIC number in the format: S/T/F/G/M + 7 digits + checksum letter (e.g., S1234567D)",
        "min": 1,
        "max": "1",
        "constraint": [
          {
            "key": "nric-format-1",
            "severity": "error",
            "human": "NRIC must follow Singapore NRIC format: S/T/F/G/M followed by 7 digits and a checksum letter",
            "expression": "matches('^[STFGM]\\\\d{7}[A-Z]$')"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:nric.period",
        "path": "Patient.identifier.period",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Patient.identifier:nric.assigner",
        "path": "Patient.identifier.assigner",
        "min": 0,
        "max": "0"
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1,
        "mustSupport": true
      }
    ]
  }
}