<OperationDefinition xmlns="http://hl7.org/fhir">
  <url value="http://electronichealth.se/fhir/OperationDefinition/NLLVerify" />
  <version value="1.1.1" />
  <name value="NLLVerify" />
  <title value="verify" />
  <status value="active" />
  <kind value="operation" />
  <date value="2025-04-28" />
  <publisher value="Swedish eHealth Agency" />
  <description value="This operation is invoked on MedicationDispense and MedicationRequest resources to verify them according to the Automatic Format and Constitution Control (sv. Automatiska format- och författningskontroller AFF-kontroller) ." />
  <affectsState value="false" />
  <code value="verify" />
  <comment value="Must be invoked with a HTTP POST. This operation is used to verify MedicationDispense and MedicationRequest resources. It is also possible to verify a set of MedicationDispenses by using $verify on the service base and providing a Bundle according to NLLDispatch or NLLTransactionBundle.&#xD;&#xA;&#xD;&#xA;NB! It is important that the content of the resource parameter matches the end-point of the request. Verification is mandatory before a dispense is registered. Verifying a prescription is an optional capability that can be utilized if it facilitates development." />
  <resource value="MedicationRequest" />
  <resource value="MedicationDispense" />
  <system value="true" />
  <type value="true" />
  <instance value="false" />
  <parameter>
    <name value="resource" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="The NLLMedicationRequest to be verified. This type of verification must be directed to the medication request end-point [base]/MedicationRequest/$verify." />
    <type value="MedicationRequest" />
  </parameter>
  <parameter>
    <name value="resource" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="The NLLMedicationDispense to be verified.&#xD;&#xA;This type of verification must be directed to the medication dispense end-point [base]/MedicationDispense/$verify." />
    <type value="MedicationDispense" />
  </parameter>
  <parameter>
    <name value="resource" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="The NLLDispensePaperPrescription to be verified.&#xD;&#xA;This type of verification must be directed to the medication dispense end-point [base]/MedicationDispense/$verify." />
    <type value="MedicationDispense" />
  </parameter>
  <parameter>
    <name value="resource" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="A NLLDispatch containing the MedicationDispenses to be verified.&#xD;&#xA;This type of verification must be directed to the service base end-point [base]/$verify." />
    <type value="Bundle" />
  </parameter>
  <parameter>
    <name value="resource" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="NLLTransactionBundle containing the resources to be verified. NB! Only NLLMedicationDispenses and associated NLLMedicationRequests are allowed. This verification must be directed to the service base end-point [base]/$verify." />
    <type value="Bundle" />
  </parameter>
  <parameter>
    <name value="detectedIssues" />
    <use value="out" />
    <min value="1" />
    <max value="1" />
    <documentation value="Has the value 'true' if any AFF errors or warnings are detected, otherwise 'false'" />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="issues" />
    <use value="out" />
    <min value="0" />
    <max value="1" />
    <documentation value="The OperationOutcome resource, shown in the profile NLLOperationOutcome is a collection of error, warning, or information messages.&#xD;&#xA;If the Automatic Format and Constitution Control (sv. Automatiska format- och författningskontroller AFF-kontroller) returns any errors or warnings, these are displayed as DetectedIssues in an OperationOutcome. No OperationOutcome will be returened if there are no issues." />
    <type value="OperationOutcome" />
  </parameter>
</OperationDefinition>