@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<https://haau3.com/fhir/CodeSystem/api-error> a fhir:CodeSystem ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "api-error"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: CodeSystem api-error</b></p><a name=\"api-error\"> </a><a name=\"hcapi-error\"> </a><p>This case-sensitive code system <code>https://haau3.com/fhir/CodeSystem/api-error</code> defines the following codes:</p><table class=\"codes\"><tr><td style=\"white-space:nowrap\"><b>Code</b></td><td><b>Display</b></td><td><b>Definition</b></td></tr><tr><td style=\"white-space:nowrap\">phi-agreement-required<a name=\"api-error-phi-agreement-required\"> </a></td><td>PHI agreement required</td><td>The request was sent to an operation that receives patient data by an organization without both a business associate agreement with haau3 in force and the Team or Scale plan, and it was not test data marked as such: the request and every resource in it labelled with the meta.security coding HTEST from http://terminology.hl7.org/CodeSystem/v3-ActReason. The operation did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden.</td></tr><tr><td style=\"white-space:nowrap\">test-key-outside-sandbox<a name=\"api-error-test-key-outside-sandbox\"> </a></td><td>Test key outside the Sandbox</td><td>The request was sent with a test API key (haau3_sk_test_) to an address outside the Sandbox, and a test key works only in the Sandbox (https://api.haau3.com/v1/sandbox/fhir/r4). The request did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden, and outside the FHIR bases in the code member of an RFC 9457 problem.</td></tr><tr><td style=\"white-space:nowrap\">live-key-in-sandbox<a name=\"api-error-live-key-in-sandbox\"> </a></td><td>Live key in the Sandbox</td><td>The request was sent with a live API key (haau3_sk_live_) to the Sandbox, which takes test keys only. The request did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden.</td></tr><tr><td style=\"white-space:nowrap\">not-open-to-customers<a name=\"api-error-not-open-to-customers\"> </a></td><td>Not open to customers</td><td>The request was sent to an operation that is not yet open to customers. The operation did not run, and the request's body was not read. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden.</td></tr></table></div>"
  ] ;
  fhir:CodeSystem.url [ fhir:value "https://haau3.com/fhir/CodeSystem/api-error"] ;
  fhir:CodeSystem.version [ fhir:value "1.0.0"] ;
  fhir:CodeSystem.name [ fhir:value "Haau3ApiErrorCS"] ;
  fhir:CodeSystem.title [ fhir:value "haau3 API Error"] ;
  fhir:CodeSystem.status [ fhir:value "active"] ;
  fhir:CodeSystem.experimental [ fhir:value "false"^^xsd:boolean] ;
  fhir:CodeSystem.date [ fhir:value "2026-11-22T18:36:32+00:00"^^xsd:dateTime] ;
  fhir:CodeSystem.publisher [ fhir:value "haau3"] ;
  fhir:CodeSystem.contact [
     fhir:index 0 ;
     fhir:ContactDetail.name [ fhir:value "haau3" ] ;
     fhir:ContactDetail.telecom [
       fhir:index 0 ;
       fhir:ContactPoint.system [ fhir:value "url" ] ;
       fhir:ContactPoint.value [ fhir:value "https://haau3.com" ]
     ], [
       fhir:index 1 ;
       fhir:ContactPoint.system [ fhir:value "email" ] ;
       fhir:ContactPoint.value [ fhir:value "hello@haau3.com" ]
     ]
  ] ;
  fhir:CodeSystem.description [ fhir:value "Why api.haau3.com refused a request, where FHIR's issue type alone does not say. Carried in OperationOutcome.issue.details.coding beside the issue type, with the reason in words in details.text."] ;
  fhir:CodeSystem.jurisdiction [
     fhir:index 0 ;
     fhir:CodeableConcept.coding [
       fhir:index 0 ;
       fhir:Coding.system [ fhir:value "urn:iso:std:iso:3166" ] ;
       fhir:Coding.code [ fhir:value "US" ] ;
       fhir:Coding.display [ fhir:value "United States of America" ]
     ]
  ] ;
  fhir:CodeSystem.caseSensitive [ fhir:value "true"^^xsd:boolean] ;
  fhir:CodeSystem.content [ fhir:value "complete"] ;
  fhir:CodeSystem.count [ fhir:value "4"^^xsd:nonNegativeInteger] ;
  fhir:CodeSystem.concept [
     fhir:index 0 ;
     fhir:CodeSystem.concept.code [ fhir:value "phi-agreement-required" ] ;
     fhir:CodeSystem.concept.display [ fhir:value "PHI agreement required" ] ;
     fhir:CodeSystem.concept.definition [ fhir:value "The request was sent to an operation that receives patient data by an organization without both a business associate agreement with haau3 in force and the Team or Scale plan, and it was not test data marked as such: the request and every resource in it labelled with the meta.security coding HTEST from http://terminology.hl7.org/CodeSystem/v3-ActReason. The operation did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden." ]
  ], [
     fhir:index 1 ;
     fhir:CodeSystem.concept.code [ fhir:value "test-key-outside-sandbox" ] ;
     fhir:CodeSystem.concept.display [ fhir:value "Test key outside the Sandbox" ] ;
     fhir:CodeSystem.concept.definition [ fhir:value "The request was sent with a test API key (haau3_sk_test_) to an address outside the Sandbox, and a test key works only in the Sandbox (https://api.haau3.com/v1/sandbox/fhir/r4). The request did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden, and outside the FHIR bases in the code member of an RFC 9457 problem." ]
  ], [
     fhir:index 2 ;
     fhir:CodeSystem.concept.code [ fhir:value "live-key-in-sandbox" ] ;
     fhir:CodeSystem.concept.display [ fhir:value "Live key in the Sandbox" ] ;
     fhir:CodeSystem.concept.definition [ fhir:value "The request was sent with a live API key (haau3_sk_live_) to the Sandbox, which takes test keys only. The request did not run. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden." ]
  ], [
     fhir:index 3 ;
     fhir:CodeSystem.concept.code [ fhir:value "not-open-to-customers" ] ;
     fhir:CodeSystem.concept.display [ fhir:value "Not open to customers" ] ;
     fhir:CodeSystem.concept.definition [ fhir:value "The request was sent to an operation that is not yet open to customers. The operation did not run, and the request's body was not read. Carried in OperationOutcome.issue.details.coding on a 403, with the issue code forbidden." ]
  ] .

# - ontology header ------------------------------------------------------------

<https://haau3.com/fhir/CodeSystem/api-error.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

