{
  "resourceType": "ValueSet",
  "status": "draft",
  "name": "NexusScheduleTemplates",
  "id": "nexus-schedule-templates",
  "title": "Schedule Templates",
  "description": "The schedule templates a schedule's rules may name, bound `extensible` from the `template` of the\n`nexus-schedule-template-rule` extension on `Schedule`. A slot does not carry its template.\n\nLists the default templates from the `nexus-schedule-template` code system. Each concept carries the\ntemplate's properties as the extensions `nexus-schedule-template-booking-limit`,\n`nexus-schedule-template-colour` and `nexus-schedule-template-booking-warning`, on its compose\nconcept and on its expansion entry. Each extension's own definition states its meaning, range and\nwhat its absence means.\n\n**Where a client reads them.** Each clinic holds this value set in its own FHIR store, so a booking\nsurface lists the templates and reads their properties from the stored expansion, found with\n`ValueSet?url=`.\n\n**The clinic owns its copy.** The four defaults seed every clinic's store. A clinic may change a\ndefault's name, colour, limit or warning, and add or remove templates; re-seeding only adds back a\ndefault code that is missing, and never rewrites or removes what the clinic holds.\n\n**A clinic's own templates** go in a second `compose.include` on its stored value set, under a code\nsystem of its own, each concept carrying the same three extensions:\n\n```\nhttps://fhir.apps.health/CodeSystem/<tenant-id>-schedule-template\n```\n\n`<tenant-id>` is the clinic's tenant id, so two clinics using the same letter do not collide. It must\nbe stable over time: change it and rules already coded under it stop matching. This is a documented\nconvention, not an artifact this guide publishes: the code system belongs to the clinic that minted\nit, so there is one per clinic and none could be declared centrally. The binding is extensible, so\na rule may name these codes.\n\n**A rule naming one of the clinic's own templates** names a code outside the set published here.\nUnder the extensible binding a validator reports that as a warning, not an error.\n\n**A reader meeting an unfamiliar code writes it back unchanged.**",
  "url": "https://fhir.apps.health/ValueSet/nexus-schedule-templates",
  "experimental": false,
  "compose": {
    "include": [
      {
        "system": "https://fhir.apps.health/CodeSystem/nexus-schedule-template",
        "concept": [
          {
            "code": "B",
            "display": "Blocked",
            "extension": [
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-booking-limit",
                "valueInteger": 0
              },
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-colour",
                "valueString": "#A3AFBF"
              },
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-booking-warning",
                "valueString": "Blocked appointment slot"
              }
            ]
          },
          {
            "code": "S",
            "display": "Same Day",
            "extension": [
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-colour",
                "valueString": "#4F86C6"
              }
            ]
          },
          {
            "code": "P",
            "display": "Physical",
            "extension": [
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-booking-limit",
                "valueInteger": 1
              },
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-colour",
                "valueString": "#6ABF69"
              }
            ]
          },
          {
            "code": "V",
            "display": "Virtual",
            "extension": [
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-colour",
                "valueString": "#9B6FC6"
              },
              {
                "url": "https://fhir.apps.health/StructureDefinition/nexus-schedule-template-booking-warning",
                "valueString": "Virtual only"
              }
            ]
          }
        ]
      }
    ]
  }
}
