better date extraction during PopulateAndExtractSearchParameters

adding allergy_intolerance tests
This commit is contained in:
Jason Kulatunga 2024-02-24 16:25:52 -08:00
parent 7c9d59cb86
commit 492fc27de3
No known key found for this signature in database
57 changed files with 1057 additions and 855 deletions

View File

@ -129,14 +129,14 @@ func (s *FhirAccount) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -167,14 +167,14 @@ func (s *FhirAccount) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting Period
periodResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Account.servicePeriod')")
if err == nil && periodResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, periodResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01-02", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006", periodResult.String()); err == nil {
s.Period = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", periodResult.String())
if err == nil {
s.Period = &d
}
}
}
// extracting Status

View File

@ -153,14 +153,14 @@ func (s *FhirAdverseEvent) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AdverseEvent.date')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Event
@ -181,14 +181,14 @@ func (s *FhirAdverseEvent) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -246,14 +246,14 @@ func (s *FhirAllergyIntolerance) PopulateAndExtractSearchParameters(resourceRaw
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -269,14 +269,14 @@ func (s *FhirAllergyIntolerance) PopulateAndExtractSearchParameters(resourceRaw
// extracting LastDate
lastDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.lastOccurrence')")
if err == nil && lastDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, lastDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, lastDateResult.String()); err == nil {
s.LastDate = &t
} else if t, err = time.Parse("2006-01-02", lastDateResult.String()); err == nil {
s.LastDate = &t
} else if t, err = time.Parse("2006-01", lastDateResult.String()); err == nil {
s.LastDate = &t
} else if t, err = time.Parse("2006", lastDateResult.String()); err == nil {
s.LastDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", lastDateResult.String())
if err == nil {
s.LastDate = &d
}
}
}
// extracting Manifestation
@ -287,14 +287,14 @@ func (s *FhirAllergyIntolerance) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -315,14 +315,14 @@ func (s *FhirAllergyIntolerance) PopulateAndExtractSearchParameters(resourceRaw
// extracting Onset
onsetResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.reaction.onset')")
if err == nil && onsetResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, onsetResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, onsetResult.String()); err == nil {
s.Onset = &t
} else if t, err = time.Parse("2006-01-02", onsetResult.String()); err == nil {
s.Onset = &t
} else if t, err = time.Parse("2006-01", onsetResult.String()); err == nil {
s.Onset = &t
} else if t, err = time.Parse("2006", onsetResult.String()); err == nil {
s.Onset = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", onsetResult.String())
if err == nil {
s.Onset = &d
}
}
}
// extracting Recorder

View File

@ -0,0 +1,190 @@
package database
import (
"encoding/json"
"github.com/stretchr/testify/require"
"os"
"testing"
"time"
)
func TestFhirAllergyIntolerance_ExtractSearchParameters(t *testing.T) {
t.Parallel()
//setup
//var observationJson map[string]interface{}
allergyIntoleranceBytes, err := os.ReadFile("../../../../frontend/src/lib/fixtures/r4/resources/allergyIntolerance/example1.json")
require.NoError(t, err)
//err = json.Unmarshal(allergyIntoleranceBytes, &observationJson)
//require.NoError(t, err)
//test
allergyIntoleranceModel := FhirAllergyIntolerance{}
err = allergyIntoleranceModel.PopulateAndExtractSearchParameters(allergyIntoleranceBytes)
//assert
var testClinicalStatus SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.ClinicalStatus), &testClinicalStatus)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "active",
Text: "Active",
System: "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
},
}, testClinicalStatus)
var testVerificationStatus SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.VerificationStatus), &testVerificationStatus)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "confirmed",
Text: "Confirmed",
System: "http://terminology.hl7.org/CodeSystem/allergyintolerance-verification",
},
}, testVerificationStatus)
//TODO: Special field, ignoring
//require.Equal(t, "allergy", allergyIntoleranceModel.Type)
var testCategory SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.Category), &testCategory)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "food",
},
}, testCategory)
var testCriticality SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.Criticality), &testCriticality)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "high",
},
}, testCriticality)
var testCodeSystem SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.Code), &testCodeSystem)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "227493005",
System: "http://snomed.info/sct",
Text: "Cashew nuts",
},
{
System: "http://www.nlm.nih.gov/research/umls/rxnorm",
Code: "1160593",
Text: "cashew nut allergenic extract Injectable Product",
},
}, testCodeSystem)
//var testPatient SearchParameterTokenType
//require.NoError(t, err)
//err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.Code), &testCodeSystem)
//require.NoError(t, err)
//require.Equal(t, SearchParameterTokenType{
// {
// Code: "39065001",
// System: "http://snomed.info/sct",
// Text: "Burn of ear",
// },
//}, testCodeSystem)
require.Equal(t, "2012-06-12T00:00:00Z", allergyIntoleranceModel.Onset.Format(time.RFC3339))
//TODO: require.Equal(t, "2004", allergyIntoleranceModel.Recorder)
//require.Equal(t, "2004", allergyIntoleranceModel.Asserter)
require.Equal(t, "2012-06", allergyIntoleranceModel.LastDate.Format("2006-01"))
var testSeverity SearchParameterTokenType
require.NoError(t, err)
err = json.Unmarshal(json.RawMessage(allergyIntoleranceModel.Severity), &testSeverity)
require.NoError(t, err)
require.Equal(t, SearchParameterTokenType{
{
Code: "severe",
},
{
Code: "moderate",
},
}, testSeverity)
//TODO: Manifestation
}
//func TestFhirAllergyIntolerance2_ExtractSearchParameters(t *testing.T) {
// t.Parallel()
// //setup
// //var observationJson map[string]interface{}
// conditionBytes, err := os.ReadFile("../../../../frontend/src/lib/fixtures/r4/resources/allergyIntolerance/example2.json")
// require.NoError(t, err)
// //err = json.Unmarshal(conditionBytes, &observationJson)
// //require.NoError(t, err)
//
// //test
// conditionModel := FhirCondition{}
// err = conditionModel.PopulateAndExtractSearchParameters(conditionBytes)
//
// //assert
//
// var testClinicalStatus SearchParameterTokenType
// require.NoError(t, err)
// err = json.Unmarshal(json.RawMessage(conditionModel.ClinicalStatus), &testClinicalStatus)
// require.NoError(t, err)
// require.Equal(t, SearchParameterTokenType{
// {
// Code: "active",
// System: "http://terminology.hl7.org/CodeSystem/condition-clinical",
// },
// }, testClinicalStatus)
//
// var testVerificationStatus SearchParameterTokenType
// require.NoError(t, err)
// err = json.Unmarshal(json.RawMessage(conditionModel.VerificationStatus), &testVerificationStatus)
// require.NoError(t, err)
// require.Equal(t, SearchParameterTokenType{
// {
// Code: "confirmed",
// System: "http://terminology.hl7.org/CodeSystem/condition-ver-status",
// },
// }, testVerificationStatus)
//
// var testCategory SearchParameterTokenType
// require.NoError(t, err)
// err = json.Unmarshal(json.RawMessage(conditionModel.Category), &testCategory)
// require.NoError(t, err)
// require.Equal(t, SearchParameterTokenType{
// {
// Code: "problem-list-item",
// System: "http://terminology.hl7.org/CodeSystem/condition-category",
// Text: "Problem List Item",
// },
// }, testCategory)
//
// var testSeverity SearchParameterTokenType
// require.NoError(t, err)
// err = json.Unmarshal(json.RawMessage(conditionModel.Severity), &testSeverity)
// require.NoError(t, err)
// require.Equal(t, SearchParameterTokenType{
// {
// Code: "255604002",
// System: "http://snomed.info/sct",
// Text: "Mild",
// },
// }, testSeverity)
//
// var testOnsetInfo SearchParameterStringType
// err = json.Unmarshal(json.RawMessage(conditionModel.OnsetInfo), &testOnsetInfo)
// require.NoError(t, err)
//
// require.Equal(t, SearchParameterStringType{"approximately November 2012"}, testOnsetInfo)
//
//}

View File

@ -174,14 +174,14 @@ func (s *FhirAppointment) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Appointment.start')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -202,14 +202,14 @@ func (s *FhirAppointment) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -100,14 +100,14 @@ func (s *FhirBinary) PopulateAndExtractSearchParameters(resourceRaw json.RawMess
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -229,14 +229,14 @@ func (s *FhirCarePlan) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting ActivityDate
activityDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'CarePlan.activity.detail.scheduledTiming | CarePlan.activity.detail.scheduledPeriod | CarePlan.activity.detail.scheduledString')")
if err == nil && activityDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, activityDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, activityDateResult.String()); err == nil {
s.ActivityDate = &t
} else if t, err = time.Parse("2006-01-02", activityDateResult.String()); err == nil {
s.ActivityDate = &t
} else if t, err = time.Parse("2006-01", activityDateResult.String()); err == nil {
s.ActivityDate = &t
} else if t, err = time.Parse("2006", activityDateResult.String()); err == nil {
s.ActivityDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", activityDateResult.String())
if err == nil {
s.ActivityDate = &d
}
}
}
// extracting ActivityReference
@ -267,14 +267,14 @@ func (s *FhirCarePlan) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -315,14 +315,14 @@ func (s *FhirCarePlan) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -181,14 +181,14 @@ func (s *FhirCareTeam) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -209,14 +209,14 @@ func (s *FhirCareTeam) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -164,14 +164,14 @@ func (s *FhirClaim) PopulateAndExtractSearchParameters(resourceRaw json.RawMessa
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Claim.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting DetailUdi
@ -217,14 +217,14 @@ func (s *FhirClaim) PopulateAndExtractSearchParameters(resourceRaw json.RawMessa
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -135,14 +135,14 @@ func (s *FhirClaimResponse) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ClaimResponse.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting Disposition
@ -168,14 +168,14 @@ func (s *FhirClaimResponse) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -201,14 +201,14 @@ func (s *FhirClaimResponse) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting PaymentDate
paymentDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ClaimResponse.payment.date')")
if err == nil && paymentDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, paymentDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, paymentDateResult.String()); err == nil {
s.PaymentDate = &t
} else if t, err = time.Parse("2006-01-02", paymentDateResult.String()); err == nil {
s.PaymentDate = &t
} else if t, err = time.Parse("2006-01", paymentDateResult.String()); err == nil {
s.PaymentDate = &t
} else if t, err = time.Parse("2006", paymentDateResult.String()); err == nil {
s.PaymentDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", paymentDateResult.String())
if err == nil {
s.PaymentDate = &d
}
}
}
// extracting Request

View File

@ -252,14 +252,14 @@ func (s *FhirComposition) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -285,14 +285,14 @@ func (s *FhirComposition) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -313,14 +313,14 @@ func (s *FhirComposition) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting Period
periodResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Composition.event.period')")
if err == nil && periodResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, periodResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01-02", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006", periodResult.String()); err == nil {
s.Period = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", periodResult.String())
if err == nil {
s.Period = &d
}
}
}
// extracting RelatedId

View File

@ -230,14 +230,14 @@ func (s *FhirCondition) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting AbatementDate
abatementDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Condition.abatementDateTime | Condition.abatementPeriod')")
if err == nil && abatementDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, abatementDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, abatementDateResult.String()); err == nil {
s.AbatementDate = &t
} else if t, err = time.Parse("2006-01-02", abatementDateResult.String()); err == nil {
s.AbatementDate = &t
} else if t, err = time.Parse("2006-01", abatementDateResult.String()); err == nil {
s.AbatementDate = &t
} else if t, err = time.Parse("2006", abatementDateResult.String()); err == nil {
s.AbatementDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", abatementDateResult.String())
if err == nil {
s.AbatementDate = &d
}
}
}
// extracting AbatementString
@ -298,14 +298,14 @@ func (s *FhirCondition) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -331,14 +331,14 @@ func (s *FhirCondition) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting OnsetDate
onsetDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Condition.onsetDateTime | Condition.onsetPeriod')")
if err == nil && onsetDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, onsetDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, onsetDateResult.String()); err == nil {
s.OnsetDate = &t
} else if t, err = time.Parse("2006-01-02", onsetDateResult.String()); err == nil {
s.OnsetDate = &t
} else if t, err = time.Parse("2006-01", onsetDateResult.String()); err == nil {
s.OnsetDate = &t
} else if t, err = time.Parse("2006", onsetDateResult.String()); err == nil {
s.OnsetDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", onsetDateResult.String())
if err == nil {
s.OnsetDate = &d
}
}
}
// extracting OnsetInfo
@ -349,14 +349,14 @@ func (s *FhirCondition) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting RecordedDate
recordedDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Condition.recordedDate')")
if err == nil && recordedDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, recordedDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, recordedDateResult.String()); err == nil {
s.RecordedDate = &t
} else if t, err = time.Parse("2006-01-02", recordedDateResult.String()); err == nil {
s.RecordedDate = &t
} else if t, err = time.Parse("2006-01", recordedDateResult.String()); err == nil {
s.RecordedDate = &t
} else if t, err = time.Parse("2006", recordedDateResult.String()); err == nil {
s.RecordedDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", recordedDateResult.String())
if err == nil {
s.RecordedDate = &d
}
}
}
// extracting Severity

View File

@ -229,14 +229,14 @@ func (s *FhirConsent) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -252,14 +252,14 @@ func (s *FhirConsent) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -285,14 +285,14 @@ func (s *FhirConsent) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting Period
periodResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Consent.provision.period')")
if err == nil && periodResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, periodResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01-02", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006", periodResult.String()); err == nil {
s.Period = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", periodResult.String())
if err == nil {
s.Period = &d
}
}
}
// extracting Purpose

View File

@ -161,14 +161,14 @@ func (s *FhirCoverage) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -119,14 +119,14 @@ func (s *FhirCoverageEligibilityRequest) PopulateAndExtractSearchParameters(reso
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'CoverageEligibilityRequest.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting Enterer
@ -152,14 +152,14 @@ func (s *FhirCoverageEligibilityRequest) PopulateAndExtractSearchParameters(reso
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -127,14 +127,14 @@ func (s *FhirCoverageEligibilityResponse) PopulateAndExtractSearchParameters(res
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'CoverageEligibilityResponse.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting Disposition
@ -160,14 +160,14 @@ func (s *FhirCoverageEligibilityResponse) PopulateAndExtractSearchParameters(res
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -160,14 +160,14 @@ func (s *FhirDevice) PopulateAndExtractSearchParameters(resourceRaw json.RawMess
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -228,14 +228,14 @@ func (s *FhirDeviceRequest) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting AuthoredOn
authoredOnResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'DeviceRequest.authoredOn')")
if err == nil && authoredOnResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, authoredOnResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, authoredOnResult.String()); err == nil {
s.AuthoredOn = &t
} else if t, err = time.Parse("2006-01-02", authoredOnResult.String()); err == nil {
s.AuthoredOn = &t
} else if t, err = time.Parse("2006-01", authoredOnResult.String()); err == nil {
s.AuthoredOn = &t
} else if t, err = time.Parse("2006", authoredOnResult.String()); err == nil {
s.AuthoredOn = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", authoredOnResult.String())
if err == nil {
s.AuthoredOn = &d
}
}
}
// extracting BasedOn
@ -261,14 +261,14 @@ func (s *FhirDeviceRequest) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting EventDate
eventDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(DeviceRequest.occurrenceDateTime) | (DeviceRequest.occurrencePeriod)')")
if err == nil && eventDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, eventDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, eventDateResult.String()); err == nil {
s.EventDate = &t
} else if t, err = time.Parse("2006-01-02", eventDateResult.String()); err == nil {
s.EventDate = &t
} else if t, err = time.Parse("2006-01", eventDateResult.String()); err == nil {
s.EventDate = &t
} else if t, err = time.Parse("2006", eventDateResult.String()); err == nil {
s.EventDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", eventDateResult.String())
if err == nil {
s.EventDate = &d
}
}
}
// extracting GroupIdentifier
@ -309,14 +309,14 @@ func (s *FhirDeviceRequest) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -260,14 +260,14 @@ func (s *FhirDiagnosticReport) PopulateAndExtractSearchParameters(resourceRaw js
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -283,14 +283,14 @@ func (s *FhirDiagnosticReport) PopulateAndExtractSearchParameters(resourceRaw js
// extracting Issued
issuedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'DiagnosticReport.issued')")
if err == nil && issuedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, issuedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, issuedResult.String()); err == nil {
s.Issued = &t
} else if t, err = time.Parse("2006-01-02", issuedResult.String()); err == nil {
s.Issued = &t
} else if t, err = time.Parse("2006-01", issuedResult.String()); err == nil {
s.Issued = &t
} else if t, err = time.Parse("2006", issuedResult.String()); err == nil {
s.Issued = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", issuedResult.String())
if err == nil {
s.Issued = &d
}
}
}
// extracting Language
@ -306,14 +306,14 @@ func (s *FhirDiagnosticReport) PopulateAndExtractSearchParameters(resourceRaw js
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -177,14 +177,14 @@ func (s *FhirDocumentManifest) PopulateAndExtractSearchParameters(resourceRaw js
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'DocumentManifest.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting Description
@ -210,14 +210,14 @@ func (s *FhirDocumentManifest) PopulateAndExtractSearchParameters(resourceRaw js
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -252,14 +252,14 @@ func (s *FhirDocumentReference) PopulateAndExtractSearchParameters(resourceRaw j
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'DocumentReference.date')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Description
@ -305,14 +305,14 @@ func (s *FhirDocumentReference) PopulateAndExtractSearchParameters(resourceRaw j
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -333,14 +333,14 @@ func (s *FhirDocumentReference) PopulateAndExtractSearchParameters(resourceRaw j
// extracting Period
periodResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'DocumentReference.context.period')")
if err == nil && periodResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, periodResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01-02", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006-01", periodResult.String()); err == nil {
s.Period = &t
} else if t, err = time.Parse("2006", periodResult.String()); err == nil {
s.Period = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", periodResult.String())
if err == nil {
s.Period = &d
}
}
}
// extracting Related

View File

@ -252,14 +252,14 @@ func (s *FhirEncounter) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Diagnosis
@ -295,27 +295,27 @@ func (s *FhirEncounter) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting LocationPeriod
locationPeriodResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Encounter.location.period')")
if err == nil && locationPeriodResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, locationPeriodResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, locationPeriodResult.String()); err == nil {
s.LocationPeriod = &t
} else if t, err = time.Parse("2006-01-02", locationPeriodResult.String()); err == nil {
s.LocationPeriod = &t
} else if t, err = time.Parse("2006-01", locationPeriodResult.String()); err == nil {
s.LocationPeriod = &t
} else if t, err = time.Parse("2006", locationPeriodResult.String()); err == nil {
s.LocationPeriod = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", locationPeriodResult.String())
if err == nil {
s.LocationPeriod = &d
}
}
}
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -134,14 +134,14 @@ func (s *FhirEndpoint) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -117,14 +117,14 @@ func (s *FhirEnrollmentRequest) PopulateAndExtractSearchParameters(resourceRaw j
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -117,14 +117,14 @@ func (s *FhirEnrollmentResponse) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -174,14 +174,14 @@ func (s *FhirExplanationOfBenefit) PopulateAndExtractSearchParameters(resourceRa
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ExplanationOfBenefit.created')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting DetailUdi
@ -227,14 +227,14 @@ func (s *FhirExplanationOfBenefit) PopulateAndExtractSearchParameters(resourceRa
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -202,14 +202,14 @@ func (s *FhirFamilyMemberHistory) PopulateAndExtractSearchParameters(resourceRaw
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -235,14 +235,14 @@ func (s *FhirFamilyMemberHistory) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -181,14 +181,14 @@ func (s *FhirGoal) PopulateAndExtractSearchParameters(resourceRaw json.RawMessag
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -209,14 +209,14 @@ func (s *FhirGoal) PopulateAndExtractSearchParameters(resourceRaw json.RawMessag
// extracting StartDate
startDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(Goal.startDate)')")
if err == nil && startDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, startDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, startDateResult.String()); err == nil {
s.StartDate = &t
} else if t, err = time.Parse("2006-01-02", startDateResult.String()); err == nil {
s.StartDate = &t
} else if t, err = time.Parse("2006-01", startDateResult.String()); err == nil {
s.StartDate = &t
} else if t, err = time.Parse("2006", startDateResult.String()); err == nil {
s.StartDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", startDateResult.String())
if err == nil {
s.StartDate = &d
}
}
}
// extracting Subject
@ -227,14 +227,14 @@ func (s *FhirGoal) PopulateAndExtractSearchParameters(resourceRaw json.RawMessag
// extracting TargetDate
targetDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(Goal.target.dueDate)')")
if err == nil && targetDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, targetDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, targetDateResult.String()); err == nil {
s.TargetDate = &t
} else if t, err = time.Parse("2006-01-02", targetDateResult.String()); err == nil {
s.TargetDate = &t
} else if t, err = time.Parse("2006-01", targetDateResult.String()); err == nil {
s.TargetDate = &t
} else if t, err = time.Parse("2006", targetDateResult.String()); err == nil {
s.TargetDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", targetDateResult.String())
if err == nil {
s.TargetDate = &d
}
}
}
// extracting Text

View File

@ -237,14 +237,14 @@ func (s *FhirImagingStudy) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -290,14 +290,14 @@ func (s *FhirImagingStudy) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting Started
startedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ImagingStudy.started')")
if err == nil && startedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, startedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, startedResult.String()); err == nil {
s.Started = &t
} else if t, err = time.Parse("2006-01-02", startedResult.String()); err == nil {
s.Started = &t
} else if t, err = time.Parse("2006-01", startedResult.String()); err == nil {
s.Started = &t
} else if t, err = time.Parse("2006", startedResult.String()); err == nil {
s.Started = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", startedResult.String())
if err == nil {
s.Started = &d
}
}
}
// extracting Status

View File

@ -208,14 +208,14 @@ func (s *FhirImmunization) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -246,14 +246,14 @@ func (s *FhirImmunization) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -284,14 +284,14 @@ func (s *FhirImmunization) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting ReactionDate
reactionDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Immunization.reaction.date')")
if err == nil && reactionDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, reactionDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, reactionDateResult.String()); err == nil {
s.ReactionDate = &t
} else if t, err = time.Parse("2006-01-02", reactionDateResult.String()); err == nil {
s.ReactionDate = &t
} else if t, err = time.Parse("2006-01", reactionDateResult.String()); err == nil {
s.ReactionDate = &t
} else if t, err = time.Parse("2006", reactionDateResult.String()); err == nil {
s.ReactionDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", reactionDateResult.String())
if err == nil {
s.ReactionDate = &d
}
}
}
// extracting ReasonCode

View File

@ -197,14 +197,14 @@ func (s *FhirInsurancePlan) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -192,14 +192,14 @@ func (s *FhirLocation) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -144,14 +144,14 @@ func (s *FhirMedia) PopulateAndExtractSearchParameters(resourceRaw json.RawMessa
// extracting Created
createdResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Media.createdDateTime | Media.createdPeriod')")
if err == nil && createdResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, createdResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01-02", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006-01", createdResult.String()); err == nil {
s.Created = &t
} else if t, err = time.Parse("2006", createdResult.String()); err == nil {
s.Created = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", createdResult.String())
if err == nil {
s.Created = &d
}
}
}
// extracting Device
@ -177,14 +177,14 @@ func (s *FhirMedia) PopulateAndExtractSearchParameters(resourceRaw json.RawMessa
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -153,14 +153,14 @@ func (s *FhirMedication) PopulateAndExtractSearchParameters(resourceRaw json.Raw
// extracting ExpirationDate
expirationDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Medication.batch.expirationDate')")
if err == nil && expirationDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, expirationDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, expirationDateResult.String()); err == nil {
s.ExpirationDate = &t
} else if t, err = time.Parse("2006-01-02", expirationDateResult.String()); err == nil {
s.ExpirationDate = &t
} else if t, err = time.Parse("2006-01", expirationDateResult.String()); err == nil {
s.ExpirationDate = &t
} else if t, err = time.Parse("2006", expirationDateResult.String()); err == nil {
s.ExpirationDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", expirationDateResult.String())
if err == nil {
s.ExpirationDate = &d
}
}
}
// extracting Form
@ -201,14 +201,14 @@ func (s *FhirMedication) PopulateAndExtractSearchParameters(resourceRaw json.Raw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -222,14 +222,14 @@ func (s *FhirMedicationAdministration) PopulateAndExtractSearchParameters(resour
// extracting EffectiveTime
effectiveTimeResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationAdministration.effectiveDateTime | MedicationAdministration.effectivePeriod')")
if err == nil && effectiveTimeResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, effectiveTimeResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, effectiveTimeResult.String()); err == nil {
s.EffectiveTime = &t
} else if t, err = time.Parse("2006-01-02", effectiveTimeResult.String()); err == nil {
s.EffectiveTime = &t
} else if t, err = time.Parse("2006-01", effectiveTimeResult.String()); err == nil {
s.EffectiveTime = &t
} else if t, err = time.Parse("2006", effectiveTimeResult.String()); err == nil {
s.EffectiveTime = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", effectiveTimeResult.String())
if err == nil {
s.EffectiveTime = &d
}
}
}
// extracting Identifier
@ -250,14 +250,14 @@ func (s *FhirMedicationAdministration) PopulateAndExtractSearchParameters(resour
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -245,14 +245,14 @@ func (s *FhirMedicationDispense) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -308,27 +308,27 @@ func (s *FhirMedicationDispense) PopulateAndExtractSearchParameters(resourceRaw
// extracting Whenhandedover
whenhandedoverResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationDispense.whenHandedOver')")
if err == nil && whenhandedoverResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, whenhandedoverResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, whenhandedoverResult.String()); err == nil {
s.Whenhandedover = &t
} else if t, err = time.Parse("2006-01-02", whenhandedoverResult.String()); err == nil {
s.Whenhandedover = &t
} else if t, err = time.Parse("2006-01", whenhandedoverResult.String()); err == nil {
s.Whenhandedover = &t
} else if t, err = time.Parse("2006", whenhandedoverResult.String()); err == nil {
s.Whenhandedover = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", whenhandedoverResult.String())
if err == nil {
s.Whenhandedover = &d
}
}
}
// extracting Whenprepared
whenpreparedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationDispense.whenPrepared')")
if err == nil && whenpreparedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, whenpreparedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, whenpreparedResult.String()); err == nil {
s.Whenprepared = &t
} else if t, err = time.Parse("2006-01-02", whenpreparedResult.String()); err == nil {
s.Whenprepared = &t
} else if t, err = time.Parse("2006-01", whenpreparedResult.String()); err == nil {
s.Whenprepared = &t
} else if t, err = time.Parse("2006", whenpreparedResult.String()); err == nil {
s.Whenprepared = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", whenpreparedResult.String())
if err == nil {
s.Whenprepared = &d
}
}
}
return nil

View File

@ -227,14 +227,14 @@ func (s *FhirMedicationRequest) PopulateAndExtractSearchParameters(resourceRaw j
// extracting Authoredon
authoredonResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationRequest.authoredOn')")
if err == nil && authoredonResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, authoredonResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, authoredonResult.String()); err == nil {
s.Authoredon = &t
} else if t, err = time.Parse("2006-01-02", authoredonResult.String()); err == nil {
s.Authoredon = &t
} else if t, err = time.Parse("2006-01", authoredonResult.String()); err == nil {
s.Authoredon = &t
} else if t, err = time.Parse("2006", authoredonResult.String()); err == nil {
s.Authoredon = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", authoredonResult.String())
if err == nil {
s.Authoredon = &d
}
}
}
// extracting Category
@ -250,14 +250,14 @@ func (s *FhirMedicationRequest) PopulateAndExtractSearchParameters(resourceRaw j
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationRequest.dosageInstruction.timing.event')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -303,14 +303,14 @@ func (s *FhirMedicationRequest) PopulateAndExtractSearchParameters(resourceRaw j
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -214,14 +214,14 @@ func (s *FhirMedicationStatement) PopulateAndExtractSearchParameters(resourceRaw
// extracting Effective
effectiveResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'MedicationStatement.effectiveDateTime | MedicationStatement.effectivePeriod')")
if err == nil && effectiveResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, effectiveResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006-01-02", effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006-01", effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006", effectiveResult.String()); err == nil {
s.Effective = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", effectiveResult.String())
if err == nil {
s.Effective = &d
}
}
}
// extracting Identifier
@ -242,14 +242,14 @@ func (s *FhirMedicationStatement) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -192,14 +192,14 @@ func (s *FhirNutritionOrder) PopulateAndExtractSearchParameters(resourceRaw json
// extracting Datetime
datetimeResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'NutritionOrder.dateTime')")
if err == nil && datetimeResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, datetimeResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, datetimeResult.String()); err == nil {
s.Datetime = &t
} else if t, err = time.Parse("2006-01-02", datetimeResult.String()); err == nil {
s.Datetime = &t
} else if t, err = time.Parse("2006-01", datetimeResult.String()); err == nil {
s.Datetime = &t
} else if t, err = time.Parse("2006", datetimeResult.String()); err == nil {
s.Datetime = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", datetimeResult.String())
if err == nil {
s.Datetime = &d
}
}
}
// extracting Encounter
@ -235,14 +235,14 @@ func (s *FhirNutritionOrder) PopulateAndExtractSearchParameters(resourceRaw json
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -356,14 +356,14 @@ func (s *FhirObservation) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting DerivedFrom
@ -404,14 +404,14 @@ func (s *FhirObservation) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -472,14 +472,14 @@ func (s *FhirObservation) PopulateAndExtractSearchParameters(resourceRaw json.Ra
// extracting ValueDate
valueDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(Observation.valueDateTime) | (Observation.valuePeriod)')")
if err == nil && valueDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, valueDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, valueDateResult.String()); err == nil {
s.ValueDate = &t
} else if t, err = time.Parse("2006-01-02", valueDateResult.String()); err == nil {
s.ValueDate = &t
} else if t, err = time.Parse("2006-01", valueDateResult.String()); err == nil {
s.ValueDate = &t
} else if t, err = time.Parse("2006", valueDateResult.String()); err == nil {
s.ValueDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", valueDateResult.String())
if err == nil {
s.ValueDate = &d
}
}
}
// extracting ValueQuantity

View File

@ -193,14 +193,14 @@ func (s *FhirOrganization) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -156,14 +156,14 @@ func (s *FhirOrganizationAffiliation) PopulateAndExtractSearchParameters(resourc
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'OrganizationAffiliation.period')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Email
@ -194,14 +194,14 @@ func (s *FhirOrganizationAffiliation) PopulateAndExtractSearchParameters(resourc
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -314,27 +314,27 @@ func (s *FhirPatient) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting Birthdate
birthdateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Patient.birthDate | Person.birthDate | RelatedPerson.birthDate')")
if err == nil && birthdateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, birthdateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01-02", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", birthdateResult.String())
if err == nil {
s.Birthdate = &d
}
}
}
// extracting DeathDate
deathDateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(Patient.deceasedDateTime)')")
if err == nil && deathDateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, deathDateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, deathDateResult.String()); err == nil {
s.DeathDate = &t
} else if t, err = time.Parse("2006-01-02", deathDateResult.String()); err == nil {
s.DeathDate = &t
} else if t, err = time.Parse("2006-01", deathDateResult.String()); err == nil {
s.DeathDate = &t
} else if t, err = time.Parse("2006", deathDateResult.String()); err == nil {
s.DeathDate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", deathDateResult.String())
if err == nil {
s.DeathDate = &d
}
}
}
// extracting Deceased
@ -385,14 +385,14 @@ func (s *FhirPatient) PopulateAndExtractSearchParameters(resourceRaw json.RawMes
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -283,14 +283,14 @@ func (s *FhirPerson) PopulateAndExtractSearchParameters(resourceRaw json.RawMess
// extracting Birthdate
birthdateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Patient.birthDate | Person.birthDate | RelatedPerson.birthDate')")
if err == nil && birthdateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, birthdateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01-02", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", birthdateResult.String())
if err == nil {
s.Birthdate = &d
}
}
}
// extracting Email
@ -321,14 +321,14 @@ func (s *FhirPerson) PopulateAndExtractSearchParameters(resourceRaw json.RawMess
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -323,14 +323,14 @@ func (s *FhirPractitioner) PopulateAndExtractSearchParameters(resourceRaw json.R
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -176,14 +176,14 @@ func (s *FhirPractitionerRole) PopulateAndExtractSearchParameters(resourceRaw js
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'PractitionerRole.period')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Email
@ -214,14 +214,14 @@ func (s *FhirPractitionerRole) PopulateAndExtractSearchParameters(resourceRaw js
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -255,14 +255,14 @@ func (s *FhirProcedure) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'AllergyIntolerance.recordedDate | CarePlan.period | CareTeam.period | ClinicalImpression.date | Composition.date | Consent.dateTime | DiagnosticReport.effectiveDateTime | DiagnosticReport.effectivePeriod | Encounter.period | EpisodeOfCare.period | FamilyMemberHistory.date | Flag.period | (Immunization.occurrenceDateTime) | List.date | Observation.effectiveDateTime | Observation.effectivePeriod | Observation.effectiveTiming | Observation.effectiveInstant | Procedure.performedDateTime | Procedure.performedPeriod | Procedure.performedString | Procedure.performedAge | Procedure.performedRange | (RiskAssessment.occurrenceDateTime) | SupplyRequest.authoredOn')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Encounter
@ -298,14 +298,14 @@ func (s *FhirProcedure) PopulateAndExtractSearchParameters(resourceRaw json.RawM
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -161,14 +161,14 @@ func (s *FhirProvenance) PopulateAndExtractSearchParameters(resourceRaw json.Raw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -189,14 +189,14 @@ func (s *FhirProvenance) PopulateAndExtractSearchParameters(resourceRaw json.Raw
// extracting Recorded
recordedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Provenance.recorded')")
if err == nil && recordedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, recordedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, recordedResult.String()); err == nil {
s.Recorded = &t
} else if t, err = time.Parse("2006-01-02", recordedResult.String()); err == nil {
s.Recorded = &t
} else if t, err = time.Parse("2006-01", recordedResult.String()); err == nil {
s.Recorded = &t
} else if t, err = time.Parse("2006", recordedResult.String()); err == nil {
s.Recorded = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", recordedResult.String())
if err == nil {
s.Recorded = &d
}
}
}
// extracting SignatureType
@ -217,14 +217,14 @@ func (s *FhirProvenance) PopulateAndExtractSearchParameters(resourceRaw json.Raw
// extracting When
whenResult, err := vm.RunString("extractDateSearchParameters(fhirResource, '(Provenance.occurredDateTime)')")
if err == nil && whenResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, whenResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, whenResult.String()); err == nil {
s.When = &t
} else if t, err = time.Parse("2006-01-02", whenResult.String()); err == nil {
s.When = &t
} else if t, err = time.Parse("2006-01", whenResult.String()); err == nil {
s.When = &t
} else if t, err = time.Parse("2006", whenResult.String()); err == nil {
s.When = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", whenResult.String())
if err == nil {
s.When = &d
}
}
}
return nil

View File

@ -183,14 +183,14 @@ func (s *FhirQuestionnaire) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Questionnaire.date')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Definition
@ -206,14 +206,14 @@ func (s *FhirQuestionnaire) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting Effective
effectiveResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Questionnaire.effectivePeriod')")
if err == nil && effectiveResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, effectiveResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006-01-02", effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006-01", effectiveResult.String()); err == nil {
s.Effective = &t
} else if t, err = time.Parse("2006", effectiveResult.String()); err == nil {
s.Effective = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", effectiveResult.String())
if err == nil {
s.Effective = &d
}
}
}
// extracting Identifier
@ -234,14 +234,14 @@ func (s *FhirQuestionnaire) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -140,14 +140,14 @@ func (s *FhirQuestionnaireResponse) PopulateAndExtractSearchParameters(resourceR
// extracting Authored
authoredResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'QuestionnaireResponse.authored')")
if err == nil && authoredResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, authoredResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006-01-02", authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006-01", authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006", authoredResult.String()); err == nil {
s.Authored = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", authoredResult.String())
if err == nil {
s.Authored = &d
}
}
}
// extracting BasedOn
@ -173,14 +173,14 @@ func (s *FhirQuestionnaireResponse) PopulateAndExtractSearchParameters(resourceR
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -280,14 +280,14 @@ func (s *FhirRelatedPerson) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting Birthdate
birthdateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Patient.birthDate | Person.birthDate | RelatedPerson.birthDate')")
if err == nil && birthdateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, birthdateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01-02", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006-01", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if t, err = time.Parse("2006", birthdateResult.String()); err == nil {
s.Birthdate = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", birthdateResult.String())
if err == nil {
s.Birthdate = &d
}
}
}
// extracting Email
@ -313,14 +313,14 @@ func (s *FhirRelatedPerson) PopulateAndExtractSearchParameters(resourceRaw json.
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -133,14 +133,14 @@ func (s *FhirSchedule) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting Date
dateResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Schedule.planningHorizon')")
if err == nil && dateResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, dateResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01-02", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006-01", dateResult.String()); err == nil {
s.Date = &t
} else if t, err = time.Parse("2006", dateResult.String()); err == nil {
s.Date = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", dateResult.String())
if err == nil {
s.Date = &d
}
}
}
// extracting Identifier
@ -156,14 +156,14 @@ func (s *FhirSchedule) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -240,14 +240,14 @@ func (s *FhirServiceRequest) PopulateAndExtractSearchParameters(resourceRaw json
// extracting Authored
authoredResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ServiceRequest.authoredOn')")
if err == nil && authoredResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, authoredResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006-01-02", authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006-01", authoredResult.String()); err == nil {
s.Authored = &t
} else if t, err = time.Parse("2006", authoredResult.String()); err == nil {
s.Authored = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", authoredResult.String())
if err == nil {
s.Authored = &d
}
}
}
// extracting BasedOn
@ -303,14 +303,14 @@ func (s *FhirServiceRequest) PopulateAndExtractSearchParameters(resourceRaw json
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -331,14 +331,14 @@ func (s *FhirServiceRequest) PopulateAndExtractSearchParameters(resourceRaw json
// extracting Occurrence
occurrenceResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'ServiceRequest.occurrenceDateTime | ServiceRequest.occurrencePeriod | ServiceRequest.occurrenceTiming')")
if err == nil && occurrenceResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, occurrenceResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, occurrenceResult.String()); err == nil {
s.Occurrence = &t
} else if t, err = time.Parse("2006-01-02", occurrenceResult.String()); err == nil {
s.Occurrence = &t
} else if t, err = time.Parse("2006-01", occurrenceResult.String()); err == nil {
s.Occurrence = &t
} else if t, err = time.Parse("2006", occurrenceResult.String()); err == nil {
s.Occurrence = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", occurrenceResult.String())
if err == nil {
s.Occurrence = &d
}
}
}
// extracting Performer

View File

@ -142,14 +142,14 @@ func (s *FhirSlot) PopulateAndExtractSearchParameters(resourceRaw json.RawMessag
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile
@ -190,14 +190,14 @@ func (s *FhirSlot) PopulateAndExtractSearchParameters(resourceRaw json.RawMessag
// extracting Start
startResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Slot.start')")
if err == nil && startResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, startResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, startResult.String()); err == nil {
s.Start = &t
} else if t, err = time.Parse("2006-01-02", startResult.String()); err == nil {
s.Start = &t
} else if t, err = time.Parse("2006-01", startResult.String()); err == nil {
s.Start = &t
} else if t, err = time.Parse("2006", startResult.String()); err == nil {
s.Start = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", startResult.String())
if err == nil {
s.Start = &d
}
}
}
// extracting Status

View File

@ -145,14 +145,14 @@ func (s *FhirSpecimen) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting Collected
collectedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'Specimen.collection.collectedDateTime | Specimen.collection.collectedPeriod')")
if err == nil && collectedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, collectedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, collectedResult.String()); err == nil {
s.Collected = &t
} else if t, err = time.Parse("2006-01-02", collectedResult.String()); err == nil {
s.Collected = &t
} else if t, err = time.Parse("2006-01", collectedResult.String()); err == nil {
s.Collected = &t
} else if t, err = time.Parse("2006", collectedResult.String()); err == nil {
s.Collected = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", collectedResult.String())
if err == nil {
s.Collected = &d
}
}
}
// extracting Collector
@ -183,14 +183,14 @@ func (s *FhirSpecimen) PopulateAndExtractSearchParameters(resourceRaw json.RawMe
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -163,14 +163,14 @@ func (s *FhirVisionPrescription) PopulateAndExtractSearchParameters(resourceRaw
// extracting Datewritten
datewrittenResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'VisionPrescription.dateWritten')")
if err == nil && datewrittenResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, datewrittenResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, datewrittenResult.String()); err == nil {
s.Datewritten = &t
} else if t, err = time.Parse("2006-01-02", datewrittenResult.String()); err == nil {
s.Datewritten = &t
} else if t, err = time.Parse("2006-01", datewrittenResult.String()); err == nil {
s.Datewritten = &t
} else if t, err = time.Parse("2006", datewrittenResult.String()); err == nil {
s.Datewritten = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", datewrittenResult.String())
if err == nil {
s.Datewritten = &d
}
}
}
// extracting Encounter
@ -191,14 +191,14 @@ func (s *FhirVisionPrescription) PopulateAndExtractSearchParameters(resourceRaw
// extracting MetaLastUpdated
metaLastUpdatedResult, err := vm.RunString("extractDateSearchParameters(fhirResource, 'meta.lastUpdated')")
if err == nil && metaLastUpdatedResult.String() != "undefined" {
t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String())
if err == nil {
if t, err := time.Parse(time.RFC3339, metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01-02", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006-01", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if t, err = time.Parse("2006", metaLastUpdatedResult.String()); err == nil {
s.MetaLastUpdated = &t
} else if err != nil {
d, err := time.Parse("2006-01-02", metaLastUpdatedResult.String())
if err == nil {
s.MetaLastUpdated = &d
}
}
}
// extracting MetaProfile

View File

@ -409,15 +409,27 @@ func main() {
break
case "date":
//parse RFC3339 date
i.List(jen.Id("t"), jen.Id("err")).Op(":=").Qual("time", "Parse").Call(jen.Qual("time", "RFC3339"), jen.Id(fieldNameVar).Dot("String").Call())
i.If(jen.Err().Op("==").Nil()).BlockFunc(func(e *jen.Group) {
i.If(
jen.List(jen.Id("t"), jen.Err()).Op(":=").Qual("time", "Parse").Call(jen.Qual("time", "RFC3339"), jen.Id(fieldNameVar).Dot("String").Call()),
jen.Err().Op("==").Nil(),
).BlockFunc(func(e *jen.Group) {
e.Id("s").Dot(fieldName).Op("=").Op("&").Id("t")
}).Else().If(
jen.List(jen.Id("t"), jen.Err()).Op("=").Qual("time", "Parse").Call(jen.Lit("2006-01-02"), jen.Id(fieldNameVar).Dot("String").Call()),
jen.Err().Op("==").Nil(),
).BlockFunc(func(e *jen.Group) {
e.Id("s").Dot(fieldName).Op("=").Op("&").Id("t")
}).Else().If(
jen.List(jen.Id("t"), jen.Err()).Op("=").Qual("time", "Parse").Call(jen.Lit("2006-01"), jen.Id(fieldNameVar).Dot("String").Call()),
jen.Err().Op("==").Nil(),
).BlockFunc(func(e *jen.Group) {
e.Id("s").Dot(fieldName).Op("=").Op("&").Id("t")
}).Else().If(
jen.List(jen.Id("t"), jen.Err()).Op("=").Qual("time", "Parse").Call(jen.Lit("2006"), jen.Id(fieldNameVar).Dot("String").Call()),
jen.Err().Op("==").Nil(),
).BlockFunc(func(e *jen.Group) {
e.Id("s").Dot(fieldName).Op("=").Op("&").Id("t")
}).Else().If(jen.Err().Op("!=").Nil()).BlockFunc(func(e *jen.Group) {
//parse date only
e.List(jen.Id("d"), jen.Id("err")).Op(":=").Qual("time", "Parse").Call(jen.Lit("2006-01-02"), jen.Id(fieldNameVar).Dot("String").Call())
e.If(jen.Err().Op("==").Nil()).BlockFunc(func(f *jen.Group) {
f.Id("s").Dot(fieldName).Op("=").Op("&").Id("d")
})
})
case "uri":
i.Id("s").Dot(fieldName).Op("=").Id(fieldNameVar).Dot("String").Call()