@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<https://fhir.ee/OperationDefinition/can-prescribe> a fhir:OperationDefinition ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "can-prescribe"] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div [ fhir:v "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: OperationDefinition can-prescribe</b></p><a name=\"can-prescribe\"> </a><a name=\"hccan-prescribe\"> </a><p>URL: [base]/Medication/$can-prescribe</p><p>URL: [base]/Patient/$can-prescribe</p><h3>Parameters</h3><table class=\"grid\"><tr><td><b>Use</b></td><td><b>Name</b></td><td><b>Scope</b></td><td><b>Cardinality</b></td><td><b>Type</b></td><td><b>Binding</b></td><td><b>Documentation</b></td></tr><tr><td>IN</td><td>subject</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R5/patient.html\">Patient</a></td><td/><td><div><p>Patient</p>\n</div></td></tr><tr><td>IN</td><td>input</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R5/medication.html\">Medication</a></td><td/><td><div><p>Medication to be checked against current medications in scheme and prescribed drafts.</p>\n</div></td></tr><tr><td>IN</td><td>draft</td><td/><td>0..*</td><td><a href=\"http://hl7.org/fhir/R5/medication.html\">Medication</a></td><td/><td><div><p>List of new medication drafts that the input medication is checked against.</p>\n</div></td></tr><tr><td>OUT</td><td>return</td><td/><td>1..1</td><td><a href=\"http://hl7.org/fhir/R5/operationoutcome.html\">OperationOutcome</a></td><td/><td><div><p>Whether conflicts were found and the nature of the conflicts.</p>\n</div></td></tr></table></div>"^^rdf:XMLLiteral ]
  ] ; # 
  fhir:extension ( [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm>
     ] ;
     fhir:value [
       a fhir:Integer ;
       fhir:v 1
     ]
  ] [
     fhir:url [
       fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"^^xsd:anyURI ;
       fhir:l <http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status>
     ] ;
     fhir:value [
       a fhir:Code ;
       fhir:v "trial-use"
     ]
  ] ) ; # 
  fhir:url [
     fhir:v "https://fhir.ee/OperationDefinition/can-prescribe"^^xsd:anyURI ;
     fhir:l <https://fhir.ee/OperationDefinition/can-prescribe>
  ] ; # 
  fhir:version [ fhir:v "1.0.0"] ; # 
  fhir:name [ fhir:v "Can Prescribe"] ; # 
  fhir:title [ fhir:v "Check if the medication can be prescribed"] ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:kind [ fhir:v "operation"] ; # 
  fhir:experimental [ fhir:v false] ; # 
  fhir:date [ fhir:v "2025-09-15T00:00:00Z"^^xsd:dateTime] ; # 
  fhir:publisher [ fhir:v "TEHIK"] ; # 
  fhir:contact ( [
     fhir:name [ fhir:v "TEHIK" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "https://www.tehik.ee" ]
     ] [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "fhir@tehik.ee" ]
     ] )
  ] [
     fhir:name [ fhir:v "TEHIK Andmekorraldus" ] ;
     fhir:telecom ( [
       fhir:system [ fhir:v "email" ] ;
       fhir:value [ fhir:v "andmekorraldus@tehik.ee" ] ;
       fhir:use [ fhir:v "work" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "The can prescribe operation checks if the Medication can be prescribed to the patient based on existing medications"] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [
         fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ;
         fhir:l <urn:iso:std:iso:3166>
       ] ;
       fhir:code [ fhir:v "EE" ] ;
       fhir:display [ fhir:v "Estonia" ]
     ] )
  ] ) ; # 
  fhir:affectsState [ fhir:v false] ; # 
  fhir:code [ fhir:v "can-prescribe"] ; # 
  fhir:resource ( [ fhir:v "Medication"] [ fhir:v "Patient"] ) ; # 
  fhir:system [ fhir:v false] ; # 
  fhir:type [ fhir:v true] ; # 
  fhir:instance [ fhir:v false] ; # 
  fhir:parameter ( [
     fhir:name [ fhir:v "subject" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v 1 ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "Patient" ] ;
     fhir:type [ fhir:v "Patient" ]
  ] [
     fhir:name [ fhir:v "input" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v 1 ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "Medication to be checked against current medications in scheme and prescribed drafts." ] ;
     fhir:type [ fhir:v "Medication" ]
  ] [
     fhir:name [ fhir:v "draft" ] ;
     fhir:use [ fhir:v "in" ] ;
     fhir:min [ fhir:v 0 ] ;
     fhir:max [ fhir:v "*" ] ;
     fhir:documentation [ fhir:v "List of new medication drafts that the input medication is checked against." ] ;
     fhir:type [ fhir:v "Medication" ]
  ] [
     fhir:name [ fhir:v "return" ] ;
     fhir:use [ fhir:v "out" ] ;
     fhir:min [ fhir:v 1 ] ;
     fhir:max [ fhir:v "1" ] ;
     fhir:documentation [ fhir:v "Whether conflicts were found and the nature of the conflicts." ] ;
     fhir:type [ fhir:v "OperationOutcome" ]
  ] ) . # 

# -------------------------------------------------------------------------------------

