private static void DoResponsiblePractitioner(MedicationRequest m, ParticipantMaker a)
        {
            Extension e = FhirHelper.MakeExtension(null, "https://fhir.nhs.uk/R4/StructureDefinition/Extension-DM-ResponsiblePractitioner",
                                                   FhirHelper.MakeInternalReference(a.Role));

            m.Extension.Add(e);
        }
        private static MedicationRequest.DispenseRequestComponent MakeDispenseRequest(ResourceReference nom, System.Collections.Generic.List <string> rx,
                                                                                      System.Collections.Generic.List <string> item)
        {
            MedicationRequest.DispenseRequestComponent dr = new MedicationRequest.DispenseRequestComponent();
            Extension e = FhirHelper.MakeExtension(null, "https://fhir.nhs.uk/R4/StructureDefinition/Extension-performerType",
                                                   FhirHelper.MakeCoding("https://fhir.nhs.uk/R4/CodeSystem/dispensing-site-preference", rx[EMUData.DISPENSINGSITEPREFERENCE], null));

            try
            {
                dr.Quantity = new SimpleQuantity
                {
                    Code   = item[EMUData.QUANTITYCODE],
                    System = "http://snomed.info/sct",
                    Unit   = item[EMUData.QUANTITYTEXT],
                    Value  = Convert.ToDecimal(item[EMUData.QUANTITYCOUNT])
                };
            }
            catch (Exception ex)
            {
#pragma warning disable CA2241 // Provide correct arguments to formatting methods
                Console.WriteLine("Exception: {ex} making SimpleQuantity: {value}", ex.Message, item[EMUData.QUANTITYCOUNT]);
#pragma warning restore CA2241 // Provide correct arguments to formatting methods
            }
            if (nom != null)
            {
                dr.Performer = nom;
            }
            dr.Extension.Add(e);
            return(dr);
        }
        private static Identifier MakeGroupIdentifier(System.Collections.Generic.List <string> rx)
        {
            Identifier sfid = FhirHelper.MakeIdentifier("https://fhir.nhs.uk/Id/prescription-short-form",
                                                        rx[EMUData.PRESCRIPTIONID]);
            Extension e = FhirHelper.MakeExtension(null, "https://fhir.nhs.uk/R4/StructureDefinition/Extension-PrescriptionId",
                                                   FhirHelper.MakeIdentifier("https://fhir.nhs.uk/Id/prescription", rx[EMUData.PRESCRIPTIONCLINICALSTATEMENTID]));

            sfid.Extension.Add(e);
            return(sfid);
        }
        private static MessageHeader.MessageSourceComponent MakeSource()
        {
            MessageHeader.MessageSourceComponent s = new MessageHeader.MessageSourceComponent();
            Extension a = FhirHelper.MakeExtension("https://fhir.nhs.uk/R4/StructureDefinition/Extension-spineEndpoint",
                                                   FhirHelper.MakeIdentifier("https://fhir.nhs.uk/Id/spine-ASID", asid));

            s.Extension.Add(a);
            s.Name     = ods;
            s.Endpoint = url;
            return(s);
        }
        private static void DoPrescriptionType(MedicationRequest m, System.Collections.Generic.List <string> rx)
        {
            Coding ptc = FhirHelper.MakeCoding("https://fhir.nhs.uk/R4/CodeSystem/prescription-type", rx[EMUData.PRESCRIPTIONTYPE], null);

            if (rx[EMUData.PRESCRIPTIONTYPE].Equals("0001"))
            {
                ptc.Display = "General Practitioner Prescribing";
            }
            Extension e = FhirHelper.MakeExtension(null, "https://fhir.nhs.uk/R4/StructureDefinition/Extension-prescriptionType", ptc);

            m.Extension.Add(e);
        }