{
  "resourceType": "Parameters",
  "meta": {
    "tag": [
      {
        "display": "Verify NLLTransactionBundle"
      },
      {
        "display": "Verify an update of prescription and register a dispense in one transaction"
      },
      {
        "display": "verify-transactionBundle-exemple1"
      }
    ]
  },
  "parameter": [
    {
      "name": "resource",
      "resource": {
        "resourceType": "Bundle",
        "meta": {
          "profile": [
            "http://electronichealth.se/fhir/StructureDefinition/NLLTransactionBundle"
          ]
        },
        "type": "transaction",
        "entry": [
          {
            "resource": {
              "resourceType": "MedicationRequest",
              "id": "5aeb998f-3a28-44a0-a32f-eb4ba5af4d89",
              "meta": {
                "versionId": "1",
                "profile": [
                  "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationRequest"
                ]
              },
              "contained": [
                {
                  "resourceType": "Practitioner",
                  "id": "1",
                  "meta": {
                    "profile": [
                      "http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner"
                    ]
                  },
                  "extension": [
                    {
                      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLWorkplaceSummary",
                      "extension": [
                        {
                          "url": "workplaceIdentifier",
                          "valueString": "7711222222"
                        },
                        {
                          "url": "workplaceName",
                          "valueString": "Min vardcentral"
                        },
                        {
                          "url": "workplaceType",
                          "valueCode": "HEALTHCAREUNIT"
                        },
                        {
                          "url": "workplaceIdType",
                          "valueCode": "ORGNR"
                        }
                      ]
                    }
                  ],
                  "name": [
                    {
                      "family": "Larsson",
                      "given": [
                        "Lars"
                      ]
                    }
                  ],
                  "telecom": [
                    {
                      "extension": [
                        {
                          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient",
                          "valueBoolean": false
                        },
                        {
                          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLContactPointType",
                          "valueCode": "P"
                        }
                      ],
                      "system": "phone",
                      "value": "070-1234455",
                      "rank": 1
                    },
                    {
                      "extension": [
                        {
                          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAvailableToPatient",
                          "valueBoolean": true
                        },
                        {
                          "url": "http://electronichealth.se/fhir/StructureDefinition/NLLContactPointType",
                          "valueCode": "W"
                        }
                      ],
                      "system": "phone",
                      "value": "011-900000",
                      "rank": 1
                    }
                  ],
                  "address": [
                    {
                      "type": "physical",
                      "line": [
                        "fysiskaGatan 134"
                      ],
                      "city": "stockholm",
                      "postalCode": "12345"
                    },
                    {
                      "type": "postal",
                      "line": [
                        "postGatan 133"
                      ],
                      "city": "stockholm",
                      "postalCode": "12345"
                    }
                  ],
                  "qualification": [
                    {
                      "identifier": [
                        {
                          "system": "urn:oid:1.2.752.116.3.1.2",
                          "value": "9000027"
                        }
                      ],
                      "code": {
                        "coding": [
                          {
                            "system": "urn:oid:1.2.752.116.3.1.3",
                            "code": "LK"
                          }
                        ]
                      }
                    }
                  ]
                }
              ],
              "extension": [
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionChain",
                  "valueUuid": "urn:uuid:388b1b60-b3fc-4f5b-baff-f4d814a8982a"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPatientTreatmentReason",
                  "valueString": "testtext - NLLPatientTreatmentReason - Behandlingsändamål"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLRegistrationBasis",
                  "valueCode": "PAPER"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionFormat",
                  "valueCode": "ELEKTRONISKT"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLOrdinationsId",
                  "valueDecimal": 125680
                }
              ],
              "identifier": [
                {
                  "extension": [
                    {
                      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNEFId",
                      "extension": [
                        {
                          "url": "PrescriptionSetId",
                          "valueString": "60dc99e6-3b9a-44c6-a627-dbde5d3613aa"
                        }
                      ]
                    }
                  ],
                  "system": "http://electronichealth.se/fhir/NamingSystem/NEFId",
                  "value": "60dc99e6-3b9a-44c6-a627-dbde5d3613aa"
                }
              ],
              "status": "active",
              "intent": "order",
              "medicationCodeableConcept": {
                "coding": [
                  {
                    "system": "http://electronichealth.se/fhir/NamingSystem/nplid",
                    "code": "20191024000023"
                  },
                  {
                    "system": "http://electronichealth.se/fhir/NamingSystem/nplpackid",
                    "code": "20200128100420"
                  }
                ]
              },
              "subject": {
                "reference": "Patient/0f539836-8824-4692-ac23-8ea5d274eaa2"
              },
              "authoredOn": "2025-03-12T23:00:00+00:00",
              "requester": {
                "reference": "#1"
              },
              "dosageInstruction": [
                {
                  "extension": [
                    {
                      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLObservandumDose",
                      "valueBoolean": true
                    },
                    {
                      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLAdministeringInstruction",
                      "valueString": "Administreringsinstruktion"
                    },
                    {
                      "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDosageType",
                      "valueCode": "FRITEXTDOSERING"
                    }
                  ],
                  "sequence": 1,
                  "text": "Fritextdoseringstext ta x y varje z",
                  "patientInstruction": "Doseringsinstruktion",
                  "asNeededBoolean": true,
                  "method": {
                    "coding": [
                      {
                        "system": "http://snomed.info/sct",
                        "code": "59691000052104"
                      }
                    ]
                  }
                }
              ],
              "dispenseRequest": {
                "extension": [
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesPrescribed",
                    "valuePositiveInt": 2
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfFillsRemaining",
                    "valueUnsignedInt": 2
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDosePackaging",
                    "valueBoolean": false
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLTotalQuantity",
                    "extension": [
                      {
                        "url": "prescribed",
                        "valueQuantity": {
                          "value": 400.0
                        }
                      },
                      {
                        "url": "remaining",
                        "valueQuantity": {
                          "value": 400.0
                        }
                      }
                    ]
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriberCostCenter",
                    "valueIdentifier": {
                      "value": "4000000000000"
                    }
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPrescriptionCommunicableDiseasesAct",
                    "valueBoolean": true
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLPatientPharmaceuticalBenefitsAct",
                    "valueBoolean": true
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLConditionsPharmaceuticalBenefitsAct",
                    "valueBoolean": true
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLBenefitDetails",
                    "extension": [
                      {
                        "url": "dailyBenefitQuantity",
                        "valueQuantity": {
                          "value": "20.0"
                        }
                      },
                      {
                        "url": "dailyBenefitQuantityUnfeasible",
                        "valueBoolean": false
                      }
                    ]
                  },
                  {
                    "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfDispensesAllowed",
                    "valueUnsignedInt": 2
                  }
                ],
                "validityPeriod": {
                  "end": "2025-09-13"
                },
                "numberOfRepeatsAllowed": 1,
                "quantity": {
                  "value": 200.0
                }
              }
            },
            "request": {
              "extension": [
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceDetails",
                  "extension": [
                    {
                      "url": "reason",
                      "valueCodeableConcept": {
                        "coding": [
                          {
                            "code": "55081000052105"
                          }
                        ]
                      }
                    },
                    {
                      "url": "activity",
                      "valueCodeableConcept": {
                        "coding": [
                          {
                            "code": "UPPDATERA_FORSKRIVNING"
                          }
                        ]
                      }
                    }
                  ]
                }
              ],
              "method": "PUT",
              "url": "MedicationRequest"
            }
          },
          {
            "resource": {
              "resourceType": "MedicationDispense",
              "meta": {
                "profile": [
                  "http://electronichealth.se/fhir/StructureDefinition/NLLMedicationDispense"
                ]
              },
              "extension": [
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLActorDispatchId",
                  "valueString": "2"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLNumberOfPackagesDispensed",
                  "valuePositiveInt": 2
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLBenefitChoiceCode",
                  "valueCode": "U"
                },
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLDispatchRowNo",
                  "valueDecimal": 1
                }
              ],
              "status": "completed",
              "medicationCodeableConcept": {
                "coding": [
                  {
                    "system": "http://electronichealth.se/fhir/NamingSystem/nplid",
                    "code": "20191024000023"
                  },
                  {
                    "system": "http://electronichealth.se/fhir/NamingSystem/nplpackid",
                    "code": "20200128100420"
                  }
                ]
              },
              "authorizingPrescription": [
                {
                  "reference": "MedicationRequest/5aeb998f-3a28-44a0-a32f-eb4ba5af4d89/_history/1"
                }
              ],
              "type": [
                {
                  "coding": [
                    {
                      "code": "SP"
                    }
                  ]
                }
              ],
              "whenHandedOver": "2025-03-13",
              "note": [
                {
                  "text": "uttag 2"
                }
              ],
              "substitution": {
                "wasSubstituted": false
              }
            },
            "request": {
              "extension": [
                {
                  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceDetails",
                  "extension": [
                    {
                      "url": "activity",
                      "valueCodeableConcept": {
                        "coding": [
                          {
                            "code": "EXPEDIERA"
                          }
                        ]
                      }
                    }
                  ]
                }
              ],
              "method": "POST",
              "url": "MedicationDispense"
            }
          }
        ]
      }
    }
  ]
}