0.1.0 - ci-build
            
          
CAREWareFHIRDataDictionary - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
This page details how a FHIR Observation(Laboratory) resource gets used and converted into a CAREWare approved PDI file.
PDI Column: tst_comment
FHIR Element: Lab.code.coding
CWFP Implementation:
  column tst_comment{
  findResult sts = resource.status
      if sts.Found{
          if sts.StringValue = 'final'{
              findResult testCode = resource.code.coding[findLonicorSnomedCodes]code
              if testCode.Found{
                  findResult comment = resource.code.text
                  found comment
              }
          }
      }
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }
PDI Column: tst_cs_1
FHIR Element: Lab.status
CWFP Implementation:
  column tst_cs_1{
	 
      findResult sts = resource.status
      if sts.Found{
          if sts.StringValue = 'final'{
              findResult codingsys= resource.code.coding[findLonicorSnomedCodes]system
              if codingsys.Found {
			
                  if codingsys.StringValue.ToLower contains 'loinc.org' {
				
                      found 'LOINC'
					
                  }
				
				
              }
          }
			
      }
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
			
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }
PDI Column: tst_cs_1_def_code
FHIR Element: Lab.status
CWFP Implementation:
  column tst_cs_1_def_code{
  note finds clients fhir id
    
      findResult sts = resource.status
      if sts.Found{
          if sts.StringValue = 'final'{	
              findResult testCode = resource.code.coding[findLonicorSnomedCodes]code
              if testCode.Found{
			
                  found testCode 
              }
          }
      }
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
			
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }
PDI Column: tst_cs_1_val_code
FHIR Element: Lab.status
CWFP Implementation:
     column tst_cs_1_val_code {
  findResult sts = resource.status
  if sts.Found {
      if sts.StringValue = 'final' {
          findResult codingsys = resource.code.coding[findLonicorSnomedCodes]code
          if codingsys.Found{
              findResult cs = resource.valueQuantity.value
              if cs.Found {
                  if cs.StringValue.ToLower contains 'not detected' {
                      found 'Negative'
                  }
                  if cs.StringValue.ToLower contains 'detected' {
                      found 'Positive'
                  }
                  if cs.StringValue.ToLower contains 'nonreactive' {
                      found 'Negative'
                  }
                  if cs.StringValue.ToLower contains 'non reactive' {
                      found 'Negative'
                  }
                  if cs.StringValue.ToLower contains 'non-reactive' {
                      found 'Negative'
                  }
                  if cs.StringValue.ToLower contains 'reactive' {
                      found 'Positive'
                  }
                  found cs
              }
              findResult cs2 = resource.valueCodeableConcept.text
              if cs2.Found {
                  if cs2.StringValue.ToLower contains 'not detected' {
                      found 'Negative'
                  }
                  if cs2.StringValue.ToLower contains 'detected' {
                      found 'Positive'
                  }
                  if cs2.StringValue.ToLower contains 'non reactive' {
                      found 'Negative'
                  }
                  if cs2.StringValue.ToLower contains 'nonreactive' {
                      found 'Negative'
                  }
                  if cs2.StringValue.ToLower contains 'non-reactive' {
                      found 'Negative'
                  }
                  if cs2.StringValue.ToLower contains 'reactive' {
                      found 'Positive'
                  }
                  found cs2
              }
              findResult cs3 = resource.valueString
              if cs3.Found {
                  if cs3.StringValue.ToLower contains 'not detected' {
                      found 'Negative'
                  }
                  if cs3.StringValue.ToLower contains 'detected' {
                      found 'Positive'
                  }
                  if cs3.StringValue.ToLower contains 'nonreactive' {
                      found 'Negative'
                  }
                  if cs3.StringValue.ToLower contains 'non reactive' {
                      found 'Negative'
                  }
                  if cs3.StringValue.ToLower contains 'non-reactive' {
                      found 'Negative'
                  }
                  if cs3.StringValue.ToLower contains 'reactive' {
                      found 'Positive'
                  }
                  found cs3
              }
              findResult cs4 = resource.valueInteger
              if cs4.Found {
                  if cs4.StringValue contains '0' {
                      found 'Not Pregnant'
                  }
                  found 'Pregnant'
              }
          }
      }
		
  }    
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }
PDI Column: tst_date
FHIR Element: Lab.status
CWFP Implementation:
  column tst_date{
	
      
      findResult sts = resource.status
      if sts.Found{
          if sts.StringValue = 'final'{	
              findResult codingsys= resource.code.coding[findLonicorSnomedCodes]code
              if codingsys.Found {
              findResult cs = resource.effectiveDateTime
				
                  if cs.Found {
			
                  found cs
                  }
              findResult cs2 = resource.issued
              if cs2.Found{
              found cs2
              }	
              }
          }
      }
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
			
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }
PDI Column: match_id
FHIR Element: Lab.status
CWFP Implementation:
  column match_id{
      findResult sts = resource.status
      if sts.Found{
          if sts.StringValue = 'final'{
              findResult testCode = resource.code.coding[findLonicorSnomedCodes]code
              if testCode.Found {
              findResult id = resource.subject.reference.id
              found id
              }
          }
      }
  }
Other CWFP Query:
  forEachObj findLonicorSnomedCodes {
      note this section of code will get run for each element in the array it is assigned to
		
      findResult codingsys = system
      findResult cd= code
      if codingsys.Found {
			
          if codingsys.StringValue.ToLower contains 'loinc.org' {
				
              if cd.StringValue = '13457-7'{
                  found codingsys
              }
          }
      }
  }