<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="OperationDefinition-genomics-generate" />
  <url value="https://fhir.nhs.uk/OperationDefinition/genomics-generate" />
  <version value="0.0.1" />
  <name value="GenomicsGenerate" />
  <status value="draft" />
  <kind value="operation" />
  <experimental value="false" />
  <date value="2024-09-04" />
  <publisher value="NHS England" />
  <description value="An operation used to generate a DocumentReference resource for a genomic data file, optionally pulling the referenced data file to a central data store and generating a DRS url for the data file.&#xD;&#xA;Customised backport of the R5 DocumentReference-generate OperationDefinition: http://hl7.org/fhir/OperationDefinition/DocumentReference-generate.&#xD;&#xA;Specific profiles for input or output parameters, e.g. for certain data file types, are pending further investigation by GEL." />
  <affectsState value="true" />
  <code value="genomics-generate" />
  <resource value="DocumentReference" />
  <system value="false" />
  <type value="true" />
  <instance value="false" />
  <parameter>
    <name value="url" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="The URL to the source document. This may be a general URL or a Binary or a Composition or a Bundle.&#xD;&#xA;For a Genomic Data File, MUST be either a DRS URL or a presigned URL." />
    <type value="uri" />
  </parameter>
  <parameter>
    <name value="persist" />
    <use value="in" />
    <min value="0" />
    <max value="1" />
    <documentation value="Whether to store the document at the document end-point (/Document) or not, once it is generated (default is for the server to decide).&#xD;&#xA;For a Genomic Data File, determines whether the data file will be pulled to a central data store, or will remain on the source server. &#xD;&#xA;In all cases, the DocumentReference will be generated and stored on the server at the /DocumentReference endpoint." />
    <type value="boolean" />
  </parameter>
  <parameter>
    <name value="content-type" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="MIME type for the file. Used to determine how the reference should be processed and which context references are required." />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="context-reference" />
    <use value="in" />
    <min value="0" />
    <max value="*" />
    <documentation value="Reference to FHIR resource which provide context for the DocumentReference e.g. ServiceRequest which initiated the collection of the data file, or the Specimen from which it originated." />
    <type value="Reference" />
    <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-ServiceRequest" />
    <targetProfile value="https://fhir.hl7.org.uk/StructureDefinition/UKCore-Specimen" />
  </parameter>
  <parameter>
    <name value="author" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="ODS code for the author organization." />
    <type value="Identifier" />
  </parameter>
  <parameter>
    <name value="return" />
    <use value="out" />
    <min value="1" />
    <max value="1" />
    <documentation value="The bundle type is &quot;searchset&quot; containing DocumentReference resource and may include a Binary. If the input url refers to another server, it is at the discretion of the server whether to retrieve it or return an error." />
    <type value="Bundle" />
  </parameter>
</OperationDefinition>