adding ability to count by wildcard (source_resource_type).

internal fields like `id`, `source_id`, `source_resource_id` and `source_resource_type` are now queryable via keyword type.
This commit is contained in:
Jason Kulatunga 2023-08-23 12:24:08 -07:00
parent dbc2f49d86
commit 3fe72918fd
No known key found for this signature in database
63 changed files with 1277 additions and 853 deletions

View File

@ -27,6 +27,9 @@ const (
SearchParameterTypeQuantity SearchParameterType = "quantity"
SearchParameterTypeComposite SearchParameterType = "composite"
SearchParameterTypeSpecial SearchParameterType = "special"
SearchParameterTypeKeyword SearchParameterType = "keyword" //this is a literal/string primitive.
)
const TABLE_ALIAS = "fhir"
@ -148,6 +151,12 @@ func (sr *SqliteRepository) sqlQueryResources(ctx context.Context, query models.
//populate the group by and order by clause with the count by values
query.Aggregations.OrderBy = "count(*) DESC"
query.Aggregations.GroupBy = query.Aggregations.CountBy
if query.Aggregations.GroupBy == "*" {
//we need to get the count of all resources, so we need to remove the group by clause and replace it by
// `source_resource_type` which will be the same for all resources
query.Aggregations.GroupBy = "source_resource_type"
}
}
//process order by clause
@ -322,7 +331,7 @@ func ProcessSearchParameterValue(searchParameter SearchParameter, searchValueWit
SecondaryValues: map[string]interface{}{},
Value: searchValueWithPrefix,
}
if (searchParameter.Type == SearchParameterTypeString || searchParameter.Type == SearchParameterTypeUri) && len(searchParameterValue.Value.(string)) == 0 {
if (searchParameter.Type == SearchParameterTypeString || searchParameter.Type == SearchParameterTypeUri || searchParameter.Type == SearchParameterTypeKeyword) && len(searchParameterValue.Value.(string)) == 0 {
return searchParameterValue, fmt.Errorf("invalid search parameter value: (%s=%s)", searchParameter.Name, searchParameterValue.Value)
}
@ -533,6 +542,9 @@ func SearchCodeToWhereClause(searchParam SearchParameter, searchParamValue Searc
}
return fmt.Sprintf("(%s)", clause), searchClauseNamedParams, nil
case SearchParameterTypeKeyword:
//setup the clause
return fmt.Sprintf("(%s = @%s)", searchParam.Name, NamedParameterWithSuffix(searchParam.Name, namedParameterSuffix)), searchClauseNamedParams, nil
case SearchParameterTypeReference:
return "", nil, fmt.Errorf("search parameter type %s not supported", searchParam.Type)
}
@ -593,7 +605,7 @@ func ProcessAggregationParameter(aggregationFieldWithProperty string, searchPara
}
//primitive types should not have a modifier, we need to throw an error
if aggregationParameter.Type == SearchParameterTypeNumber || aggregationParameter.Type == SearchParameterTypeUri {
if aggregationParameter.Type == SearchParameterTypeNumber || aggregationParameter.Type == SearchParameterTypeUri || aggregationParameter.Type == SearchParameterTypeKeyword {
if len(aggregationParameter.Modifier) > 0 {
return aggregationParameter, fmt.Errorf("primitive aggregation parameter %s cannot have a property (%s)", aggregationParameter.Name, aggregationParameter.Modifier)
}

View File

@ -180,6 +180,41 @@ func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithPrimitiveOrderBy
})
}
func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithKeywordOrderByAggregation() {
//setup
sqliteRepo := suite.TestRepository.(*SqliteRepository)
sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true})
//test
authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username")
sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{
Select: []string{},
Where: map[string]interface{}{},
From: "CarePlan",
Aggregations: &models.QueryResourceAggregations{OrderBy: "id"},
})
require.NoError(suite.T(), err)
var results []map[string]interface{}
statement := sqlQuery.Find(&results).Statement
sqlString := statement.SQL.String()
sqlParams := statement.Vars
//assert
require.NoError(suite.T(), err)
require.Equal(suite.T(),
strings.Join([]string{
"SELECT fhir.*",
"FROM fhir_care_plan as fhir",
"WHERE (user_id = ?)",
"GROUP BY `fhir`.`id`",
"ORDER BY fhir.id ASC",
}, " "), sqlString)
require.Equal(suite.T(), sqlParams, []interface{}{
"00000000-0000-0000-0000-000000000000",
})
}
func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexOrderByAggregation() {
//setup
sqliteRepo := suite.TestRepository.(*SqliteRepository)
@ -254,6 +289,78 @@ func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithPrimitiveCountBy
})
}
func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithKeywordCountByAggregation() {
//setup
sqliteRepo := suite.TestRepository.(*SqliteRepository)
sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true})
//test
authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username")
sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{
Select: []string{},
Where: map[string]interface{}{
"activityCode": "test_code",
},
From: "CarePlan",
Aggregations: &models.QueryResourceAggregations{CountBy: "source_resource_type"},
})
require.NoError(suite.T(), err)
var results []map[string]interface{}
statement := sqlQuery.Find(&results).Statement
sqlString := statement.SQL.String()
sqlParams := statement.Vars
//assert
require.NoError(suite.T(), err)
require.Equal(suite.T(),
strings.Join([]string{
"SELECT fhir.source_resource_type as label, count(*) as value",
"FROM fhir_care_plan as fhir, json_each(fhir.activityCode) as activityCodeJson",
"WHERE ((activityCodeJson.value ->> '$.code' = ?)) AND (user_id = ?)",
"GROUP BY `fhir`.`source_resource_type`",
"ORDER BY count(*) DESC",
}, " "), sqlString)
require.Equal(suite.T(), sqlParams, []interface{}{
"test_code", "00000000-0000-0000-0000-000000000000",
})
}
func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithWildcardCountByAggregation() {
//setup
sqliteRepo := suite.TestRepository.(*SqliteRepository)
sqliteRepo.GormClient = sqliteRepo.GormClient.Session(&gorm.Session{DryRun: true})
//test
authContext := context.WithValue(context.Background(), pkg.ContextKeyTypeAuthUsername, "test_username")
sqlQuery, err := sqliteRepo.sqlQueryResources(authContext, models.QueryResource{
Select: []string{},
Where: map[string]interface{}{},
From: "CarePlan",
Aggregations: &models.QueryResourceAggregations{CountBy: "*"},
})
require.NoError(suite.T(), err)
var results []map[string]interface{}
statement := sqlQuery.Find(&results).Statement
sqlString := statement.SQL.String()
sqlParams := statement.Vars
//assert
require.NoError(suite.T(), err)
require.Equal(suite.T(),
strings.Join([]string{
"SELECT fhir.source_resource_type as label, count(*) as value",
"FROM fhir_care_plan as fhir",
"WHERE (user_id = ?)",
"GROUP BY `fhir`.`source_resource_type`",
"ORDER BY count(*) DESC",
}, " "), sqlString)
require.Equal(suite.T(), sqlParams, []interface{}{
"00000000-0000-0000-0000-000000000000",
})
}
func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexCountByAggregation() {
//setup
sqliteRepo := suite.TestRepository.(*SqliteRepository)

View File

@ -28,6 +28,7 @@ func TestProcessSearchParameter(t *testing.T) {
{"unknown:doesntmatter", map[string]string{"test": "string"}, SearchParameter{}, true}, //unknown search parameter shoudl throw error
{"unknown", map[string]string{"test": "string"}, SearchParameter{}, true}, //unknown search parameter shoudl throw error
{"test", map[string]string{"test": "faketype"}, SearchParameter{Type: "faketype", Name: "test", Modifier: ""}, false},
{"id", map[string]string{"id": "keyword"}, SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, false},
{"given", map[string]string{"given": "string"}, SearchParameter{Type: "string", Name: "given", Modifier: ""}, false},
{"given:contains", map[string]string{"given": "string"}, SearchParameter{Type: "string", Name: "given", Modifier: "contains"}, false},
@ -112,6 +113,8 @@ func TestProcessSearchParameterValue(t *testing.T) {
{SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "ap5.4|http://unitsofmeasure.org|mg|additional", SearchParameterValue{Value: float64(5.4), Prefix: "ap", SecondaryValues: map[string]interface{}{"valueQuantitySystem": "http://unitsofmeasure.org", "valueQuantityCode": "mg|additional"}}, false},
{SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "5.4||", SearchParameterValue{Value: float64(5.4), Prefix: "", SecondaryValues: map[string]interface{}{}}, false},
{SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "", SearchParameterValue{}, true},
{SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, "1234", SearchParameterValue{Value: "1234", SecondaryValues: map[string]interface{}{}}, false},
}
//test && assert
@ -155,6 +158,8 @@ func TestSearchCodeToWhereClause(t *testing.T) {
{SearchParameter{Type: "token", Name: "code", Modifier: ""}, SearchParameterValue{Value: "ha125", Prefix: "", SecondaryValues: map[string]interface{}{"codeSystem": "http://acme.org/conditions/codes"}}, "0_0", "(codeJson.value ->> '$.code' = @code_0_0 AND codeJson.value ->> '$.system' = @codeSystem_0_0)", map[string]interface{}{"code_0_0": "ha125", "codeSystem_0_0": "http://acme.org/conditions/codes"}, false},
{SearchParameter{Type: "token", Name: "code", Modifier: ""}, SearchParameterValue{Value: "ha125", Prefix: "", SecondaryValues: map[string]interface{}{}}, "0_0", "(codeJson.value ->> '$.code' = @code_0_0)", map[string]interface{}{"code_0_0": "ha125"}, false},
{SearchParameter{Type: "token", Name: "identifier", Modifier: "otype"}, SearchParameterValue{Value: "MR|446053", Prefix: "", SecondaryValues: map[string]interface{}{"identifierSystem": "http://terminology.hl7.org/CodeSystem/v2-0203"}}, "0_0", "(identifierJson.value ->> '$.code' = @identifier_0_0 AND identifierJson.value ->> '$.system' = @identifierSystem_0_0)", map[string]interface{}{"identifier_0_0": "MR|446053", "identifierSystem_0_0": "http://terminology.hl7.org/CodeSystem/v2-0203"}, false},
{SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, SearchParameterValue{Value: "1234", Prefix: "", SecondaryValues: map[string]interface{}{}}, "0_0", "(id = @id_0_0)", map[string]interface{}{"id_0_0": "1234"}, false},
}
//test && assert
@ -181,6 +186,7 @@ func TestSearchCodeToFromClause(t *testing.T) {
}{
{SearchParameter{Type: "number", Name: "probability", Modifier: ""}, "", false},
{SearchParameter{Type: "date", Name: "issueDate", Modifier: ""}, "", false},
{SearchParameter{Type: "keyword", Name: "id", Modifier: ""}, "", false},
{SearchParameter{Type: "token", Name: "hello", Modifier: ""}, "json_each(fhir.hello) as helloJson", false},
}

View File

@ -54,18 +54,23 @@ type FhirAccount struct {
func (s *FhirAccount) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"owner": "reference",
"period": "date",
"profile": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"owner": "reference",
"period": "date",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -72,24 +72,29 @@ type FhirAdverseEvent struct {
func (s *FhirAdverseEvent) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"actuality": "token",
"category": "token",
"date": "date",
"event": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"profile": "reference",
"recorder": "reference",
"resultingcondition": "reference",
"seriousness": "token",
"severity": "token",
"study": "reference",
"subject": "reference",
"substance": "reference",
"tag": "token",
"text": "string",
"type": "special",
"actuality": "token",
"category": "token",
"date": "date",
"event": "token",
"id": "keyword",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"profile": "reference",
"recorder": "reference",
"resultingcondition": "reference",
"seriousness": "token",
"severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"study": "reference",
"subject": "reference",
"substance": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -148,26 +148,31 @@ type FhirAllergyIntolerance struct {
func (s *FhirAllergyIntolerance) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"asserter": "reference",
"category": "token",
"clinicalStatus": "token",
"code": "token",
"criticality": "token",
"date": "date",
"identifier": "token",
"language": "token",
"lastDate": "date",
"lastUpdated": "date",
"manifestation": "token",
"onset": "date",
"profile": "reference",
"recorder": "reference",
"route": "token",
"severity": "token",
"tag": "token",
"text": "string",
"type": "special",
"verificationStatus": "token",
"asserter": "reference",
"category": "token",
"clinicalStatus": "token",
"code": "token",
"criticality": "token",
"date": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastDate": "date",
"lastUpdated": "date",
"manifestation": "token",
"onset": "date",
"profile": "reference",
"recorder": "reference",
"route": "token",
"severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"text": "string",
"type": "special",
"verificationStatus": "token",
}
return searchParameters
}

View File

@ -84,28 +84,33 @@ type FhirAppointment struct {
func (s *FhirAppointment) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"actor": "reference",
"appointmentType": "token",
"basedOn": "reference",
"date": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"partStatus": "token",
"practitioner": "reference",
"profile": "reference",
"reasonCode": "token",
"reasonReference": "reference",
"serviceCategory": "token",
"serviceType": "token",
"slot": "reference",
"specialty": "token",
"status": "token",
"supportingInfo": "reference",
"tag": "token",
"text": "string",
"type": "special",
"actor": "reference",
"appointmentType": "token",
"basedOn": "reference",
"date": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"partStatus": "token",
"practitioner": "reference",
"profile": "reference",
"reasonCode": "token",
"reasonReference": "reference",
"serviceCategory": "token",
"serviceType": "token",
"slot": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token",
"status": "token",
"supportingInfo": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -36,12 +36,17 @@ type FhirBinary struct {
func (s *FhirBinary) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"tag": "token",
"text": "string",
"type": "special",
"id": "keyword",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -156,6 +156,7 @@ func (s *FhirCarePlan) GetSearchParameters() map[string]string {
"date": "date",
"encounter": "reference",
"goal": "reference",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -166,6 +167,10 @@ func (s *FhirCarePlan) GetSearchParameters() map[string]string {
"performer": "reference",
"profile": "reference",
"replaces": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",

View File

@ -110,19 +110,24 @@ type FhirCareTeam struct {
func (s *FhirCareTeam) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"category": "token",
"date": "date",
"encounter": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"participant": "reference",
"profile": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"category": "token",
"date": "date",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"participant": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -84,28 +84,33 @@ type FhirClaim struct {
func (s *FhirClaim) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"careTeam": "reference",
"created": "date",
"detailUdi": "reference",
"encounter": "reference",
"enterer": "reference",
"facility": "reference",
"identifier": "token",
"insurer": "reference",
"itemUdi": "reference",
"language": "token",
"lastUpdated": "date",
"payee": "reference",
"priority": "token",
"procedureUdi": "reference",
"profile": "reference",
"provider": "reference",
"status": "token",
"subdetailUdi": "reference",
"tag": "token",
"text": "string",
"type": "special",
"use": "token",
"careTeam": "reference",
"created": "date",
"detailUdi": "reference",
"encounter": "reference",
"enterer": "reference",
"facility": "reference",
"id": "keyword",
"identifier": "token",
"insurer": "reference",
"itemUdi": "reference",
"language": "token",
"lastUpdated": "date",
"payee": "reference",
"priority": "token",
"procedureUdi": "reference",
"profile": "reference",
"provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subdetailUdi": "reference",
"tag": "token",
"text": "string",
"type": "special",
"use": "token",
}
return searchParameters
}

View File

@ -66,22 +66,27 @@ type FhirClaimResponse struct {
func (s *FhirClaimResponse) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"created": "date",
"disposition": "string",
"identifier": "token",
"insurer": "reference",
"language": "token",
"lastUpdated": "date",
"outcome": "token",
"paymentDate": "date",
"profile": "reference",
"request": "reference",
"requestor": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"use": "token",
"created": "date",
"disposition": "string",
"id": "keyword",
"identifier": "token",
"insurer": "reference",
"language": "token",
"lastUpdated": "date",
"outcome": "token",
"paymentDate": "date",
"profile": "reference",
"request": "reference",
"requestor": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"use": "token",
}
return searchParameters
}

View File

@ -152,28 +152,33 @@ type FhirComposition struct {
func (s *FhirComposition) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"attester": "reference",
"author": "reference",
"category": "token",
"confidentiality": "token",
"context": "token",
"date": "date",
"encounter": "reference",
"entry": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"period": "date",
"profile": "reference",
"relatedId": "token",
"relatedRef": "reference",
"section": "token",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"title": "string",
"type": "special",
"attester": "reference",
"author": "reference",
"category": "token",
"confidentiality": "token",
"context": "token",
"date": "date",
"encounter": "reference",
"entry": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"period": "date",
"profile": "reference",
"relatedId": "token",
"relatedRef": "reference",
"section": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"title": "string",
"type": "special",
}
return searchParameters
}

View File

@ -146,32 +146,37 @@ type FhirCondition struct {
func (s *FhirCondition) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"abatementAge": "quantity",
"abatementDate": "date",
"abatementString": "string",
"asserter": "reference",
"bodySite": "token",
"category": "token",
"clinicalStatus": "token",
"code": "token",
"encounter": "reference",
"evidence": "token",
"evidenceDetail": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"onsetAge": "quantity",
"onsetDate": "date",
"onsetInfo": "string",
"profile": "reference",
"recordedDate": "date",
"severity": "token",
"stage": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"verificationStatus": "token",
"abatementAge": "quantity",
"abatementDate": "date",
"abatementString": "string",
"asserter": "reference",
"bodySite": "token",
"category": "token",
"clinicalStatus": "token",
"code": "token",
"encounter": "reference",
"evidence": "token",
"evidenceDetail": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"onsetAge": "quantity",
"onsetDate": "date",
"onsetInfo": "string",
"profile": "reference",
"recordedDate": "date",
"severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"stage": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"verificationStatus": "token",
}
return searchParameters
}

View File

@ -131,26 +131,31 @@ type FhirConsent struct {
func (s *FhirConsent) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"action": "token",
"actor": "reference",
"category": "token",
"consentor": "reference",
"data": "reference",
"date": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"organization": "reference",
"period": "date",
"profile": "reference",
"purpose": "token",
"scope": "token",
"securityLabel": "token",
"sourceReference": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"action": "token",
"actor": "reference",
"category": "token",
"consentor": "reference",
"data": "reference",
"date": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"organization": "reference",
"period": "date",
"profile": "reference",
"purpose": "token",
"scope": "token",
"securityLabel": "token",
"sourceReference": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -63,21 +63,26 @@ type FhirCoverage struct {
func (s *FhirCoverage) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"beneficiary": "reference",
"classType": "token",
"classValue": "string",
"dependent": "string",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"payor": "reference",
"policyHolder": "reference",
"profile": "reference",
"status": "token",
"subscriber": "reference",
"tag": "token",
"text": "string",
"type": "special",
"beneficiary": "reference",
"classType": "token",
"classValue": "string",
"dependent": "string",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"payor": "reference",
"policyHolder": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subscriber": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -54,18 +54,23 @@ type FhirCoverageEligibilityRequest struct {
func (s *FhirCoverageEligibilityRequest) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"created": "date",
"enterer": "reference",
"facility": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"provider": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"created": "date",
"enterer": "reference",
"facility": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -60,20 +60,25 @@ type FhirCoverageEligibilityResponse struct {
func (s *FhirCoverageEligibilityResponse) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"created": "date",
"disposition": "string",
"identifier": "token",
"insurer": "reference",
"language": "token",
"lastUpdated": "date",
"outcome": "token",
"profile": "reference",
"request": "reference",
"requestor": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"created": "date",
"disposition": "string",
"id": "keyword",
"identifier": "token",
"insurer": "reference",
"language": "token",
"lastUpdated": "date",
"outcome": "token",
"profile": "reference",
"request": "reference",
"requestor": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -66,22 +66,27 @@ type FhirDevice struct {
func (s *FhirDevice) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"deviceName": "string",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"manufacturer": "string",
"model": "string",
"organization": "reference",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"udiCarrier": "string",
"udiDi": "string",
"url": "uri",
"deviceName": "string",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"manufacturer": "string",
"model": "string",
"organization": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"udiCarrier": "string",
"udiDi": "string",
"url": "uri",
}
return searchParameters
}

View File

@ -159,6 +159,7 @@ func (s *FhirDeviceRequest) GetSearchParameters() map[string]string {
"encounter": "reference",
"eventDate": "date",
"groupIdentifier": "token",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -170,6 +171,10 @@ func (s *FhirDeviceRequest) GetSearchParameters() map[string]string {
"priorRequest": "reference",
"profile": "reference",
"requester": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",

View File

@ -166,27 +166,32 @@ type FhirDiagnosticReport struct {
func (s *FhirDiagnosticReport) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"basedOn": "reference",
"category": "token",
"code": "token",
"conclusion": "token",
"date": "date",
"encounter": "reference",
"identifier": "token",
"issued": "date",
"language": "token",
"lastUpdated": "date",
"media": "reference",
"performer": "reference",
"profile": "reference",
"result": "reference",
"resultsInterpreter": "reference",
"specimen": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"basedOn": "reference",
"category": "token",
"code": "token",
"conclusion": "token",
"date": "date",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"issued": "date",
"language": "token",
"lastUpdated": "date",
"media": "reference",
"performer": "reference",
"profile": "reference",
"result": "reference",
"resultsInterpreter": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specimen": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -102,23 +102,28 @@ type FhirDocumentManifest struct {
func (s *FhirDocumentManifest) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"author": "reference",
"created": "date",
"description": "string",
"identifier": "token",
"item": "reference",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"recipient": "reference",
"relatedId": "token",
"relatedRef": "reference",
"source": "uri",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"author": "reference",
"created": "date",
"description": "string",
"id": "keyword",
"identifier": "token",
"item": "reference",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"recipient": "reference",
"relatedId": "token",
"relatedRef": "reference",
"source": "uri",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -147,33 +147,38 @@ type FhirDocumentReference struct {
func (s *FhirDocumentReference) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"authenticator": "reference",
"author": "reference",
"category": "token",
"contenttype": "token",
"custodian": "reference",
"date": "date",
"description": "string",
"encounter": "reference",
"event": "token",
"facility": "token",
"format": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "uri",
"period": "date",
"profile": "reference",
"related": "reference",
"relatesto": "reference",
"relation": "token",
"securityLabel": "token",
"setting": "token",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"authenticator": "reference",
"author": "reference",
"category": "token",
"contenttype": "token",
"custodian": "reference",
"date": "date",
"description": "string",
"encounter": "reference",
"event": "token",
"facility": "token",
"format": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "uri",
"period": "date",
"profile": "reference",
"related": "reference",
"relatesto": "reference",
"relation": "token",
"securityLabel": "token",
"setting": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -152,33 +152,38 @@ type FhirEncounter struct {
func (s *FhirEncounter) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"account": "reference",
"appointment": "reference",
"basedOn": "reference",
"class": "token",
"date": "date",
"diagnosis": "reference",
"episodeOfCare": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"length": "quantity",
"location": "reference",
"locationPeriod": "date",
"partOf": "reference",
"participant": "reference",
"participantType": "token",
"practitioner": "reference",
"profile": "reference",
"reasonCode": "token",
"reasonReference": "reference",
"serviceProvider": "reference",
"specialArrangement": "token",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"account": "reference",
"appointment": "reference",
"basedOn": "reference",
"class": "token",
"date": "date",
"diagnosis": "reference",
"episodeOfCare": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"length": "quantity",
"location": "reference",
"locationPeriod": "date",
"partOf": "reference",
"participant": "reference",
"participantType": "token",
"practitioner": "reference",
"profile": "reference",
"reasonCode": "token",
"reasonReference": "reference",
"serviceProvider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialArrangement": "token",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -54,18 +54,23 @@ type FhirEndpoint struct {
func (s *FhirEndpoint) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"connectionType": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"organization": "reference",
"payloadType": "token",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"connectionType": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"organization": "reference",
"payloadType": "token",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -45,15 +45,20 @@ type FhirEnrollmentRequest struct {
func (s *FhirEnrollmentRequest) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -45,15 +45,20 @@ type FhirEnrollmentResponse struct {
func (s *FhirEnrollmentResponse) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"request": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"request": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -84,28 +84,33 @@ type FhirExplanationOfBenefit struct {
func (s *FhirExplanationOfBenefit) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"careTeam": "reference",
"claim": "reference",
"coverage": "reference",
"created": "date",
"detailUdi": "reference",
"disposition": "string",
"encounter": "reference",
"enterer": "reference",
"facility": "reference",
"identifier": "token",
"itemUdi": "reference",
"language": "token",
"lastUpdated": "date",
"payee": "reference",
"procedureUdi": "reference",
"profile": "reference",
"provider": "reference",
"status": "token",
"subdetailUdi": "reference",
"tag": "token",
"text": "string",
"type": "special",
"careTeam": "reference",
"claim": "reference",
"coverage": "reference",
"created": "date",
"detailUdi": "reference",
"disposition": "string",
"encounter": "reference",
"enterer": "reference",
"facility": "reference",
"id": "keyword",
"identifier": "token",
"itemUdi": "reference",
"language": "token",
"lastUpdated": "date",
"payee": "reference",
"procedureUdi": "reference",
"profile": "reference",
"provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subdetailUdi": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -132,6 +132,7 @@ func (s *FhirFamilyMemberHistory) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"code": "token",
"date": "date",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -140,6 +141,10 @@ func (s *FhirFamilyMemberHistory) GetSearchParameters() map[string]string {
"profile": "reference",
"relationship": "token",
"sex": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",

View File

@ -90,19 +90,24 @@ type FhirGoal struct {
func (s *FhirGoal) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"achievementStatus": "token",
"category": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"lifecycleStatus": "token",
"profile": "reference",
"startDate": "date",
"subject": "reference",
"tag": "token",
"targetDate": "date",
"text": "string",
"type": "special",
"achievementStatus": "token",
"category": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"lifecycleStatus": "token",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"startDate": "date",
"subject": "reference",
"tag": "token",
"targetDate": "date",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -117,28 +117,33 @@ type FhirImagingStudy struct {
func (s *FhirImagingStudy) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"basedon": "reference",
"bodysite": "token",
"dicomClass": "token",
"encounter": "reference",
"endpoint": "reference",
"identifier": "token",
"instance": "token",
"interpreter": "reference",
"language": "token",
"lastUpdated": "date",
"modality": "token",
"performer": "reference",
"profile": "reference",
"reason": "token",
"referrer": "reference",
"series": "token",
"started": "date",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"basedon": "reference",
"bodysite": "token",
"dicomClass": "token",
"encounter": "reference",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"instance": "token",
"interpreter": "reference",
"language": "token",
"lastUpdated": "date",
"modality": "token",
"performer": "reference",
"profile": "reference",
"reason": "token",
"referrer": "reference",
"series": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"started": "date",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -134,27 +134,32 @@ type FhirImmunization struct {
func (s *FhirImmunization) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"date": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"lotNumber": "string",
"manufacturer": "reference",
"performer": "reference",
"profile": "reference",
"reaction": "reference",
"reactionDate": "date",
"reasonCode": "token",
"reasonReference": "reference",
"series": "string",
"status": "token",
"statusReason": "token",
"tag": "token",
"targetDisease": "token",
"text": "string",
"type": "special",
"vaccineCode": "token",
"date": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"lotNumber": "string",
"manufacturer": "reference",
"performer": "reference",
"profile": "reference",
"reaction": "reference",
"reactionDate": "date",
"reasonCode": "token",
"reasonReference": "reference",
"series": "string",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"statusReason": "token",
"tag": "token",
"targetDisease": "token",
"text": "string",
"type": "special",
"vaccineCode": "token",
}
return searchParameters
}

View File

@ -75,25 +75,30 @@ type FhirInsurancePlan struct {
func (s *FhirInsurancePlan) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"administeredBy": "reference",
"endpoint": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"ownedBy": "reference",
"phonetic": "string",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"administeredBy": "reference",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"ownedBy": "reference",
"phonetic": "string",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -75,25 +75,30 @@ type FhirLocation struct {
func (s *FhirLocation) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"endpoint": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"operationalStatus": "token",
"organization": "reference",
"partof": "reference",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"operationalStatus": "token",
"organization": "reference",
"partof": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -69,23 +69,28 @@ type FhirMedia struct {
func (s *FhirMedia) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"basedOn": "reference",
"created": "date",
"device": "reference",
"encounter": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"modality": "token",
"operator": "reference",
"profile": "reference",
"site": "token",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"view": "token",
"basedOn": "reference",
"created": "date",
"device": "reference",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"modality": "token",
"operator": "reference",
"profile": "reference",
"site": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"view": "token",
}
return searchParameters
}

View File

@ -80,21 +80,26 @@ type FhirMedication struct {
func (s *FhirMedication) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"code": "token",
"expirationDate": "date",
"form": "token",
"identifier": "token",
"ingredient": "reference",
"ingredientCode": "token",
"language": "token",
"lastUpdated": "date",
"lotNumber": "token",
"manufacturer": "reference",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"code": "token",
"expirationDate": "date",
"form": "token",
"id": "keyword",
"identifier": "token",
"ingredient": "reference",
"ingredientCode": "token",
"language": "token",
"lastUpdated": "date",
"lotNumber": "token",
"manufacturer": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -136,24 +136,29 @@ type FhirMedicationAdministration struct {
func (s *FhirMedicationAdministration) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"code": "token",
"context": "reference",
"device": "reference",
"effectiveTime": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"performer": "reference",
"profile": "reference",
"reasonGiven": "token",
"reasonNotGiven": "token",
"request": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"code": "token",
"context": "reference",
"device": "reference",
"effectiveTime": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"performer": "reference",
"profile": "reference",
"reasonGiven": "token",
"reasonNotGiven": "token",
"request": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -143,25 +143,30 @@ type FhirMedicationDispense struct {
func (s *FhirMedicationDispense) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"code": "token",
"context": "reference",
"destination": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"performer": "reference",
"prescription": "reference",
"profile": "reference",
"receiver": "reference",
"responsibleparty": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"whenhandedover": "date",
"whenprepared": "date",
"code": "token",
"context": "reference",
"destination": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"performer": "reference",
"prescription": "reference",
"profile": "reference",
"receiver": "reference",
"responsibleparty": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"whenhandedover": "date",
"whenprepared": "date",
}
return searchParameters
}

View File

@ -158,6 +158,7 @@ func (s *FhirMedicationRequest) GetSearchParameters() map[string]string {
"code": "token",
"date": "date",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"intendedDispenser": "reference",
"intendedPerformer": "reference",
@ -169,6 +170,10 @@ func (s *FhirMedicationRequest) GetSearchParameters() map[string]string {
"priority": "token",
"profile": "reference",
"requester": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",

View File

@ -130,22 +130,27 @@ type FhirMedicationStatement struct {
func (s *FhirMedicationStatement) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"category": "token",
"code": "token",
"context": "reference",
"effective": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"partOf": "reference",
"profile": "reference",
"source": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"category": "token",
"code": "token",
"context": "reference",
"effective": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"medication": "reference",
"partOf": "reference",
"profile": "reference",
"source": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -121,6 +121,7 @@ func (s *FhirNutritionOrder) GetSearchParameters() map[string]string {
"datetime": "date",
"encounter": "reference",
"formula": "token",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -129,6 +130,10 @@ func (s *FhirNutritionOrder) GetSearchParameters() map[string]string {
"oraldiet": "token",
"profile": "reference",
"provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"supplement": "token",
"tag": "token",

View File

@ -226,6 +226,7 @@ func (s *FhirObservation) GetSearchParameters() map[string]string {
"encounter": "reference",
"focus": "reference",
"hasMember": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
@ -233,6 +234,10 @@ func (s *FhirObservation) GetSearchParameters() map[string]string {
"partOf": "reference",
"performer": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specimen": "reference",
"status": "token",
"subject": "reference",

View File

@ -72,24 +72,29 @@ type FhirOrganization struct {
func (s *FhirOrganization) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"endpoint": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"partof": "reference",
"phonetic": "string",
"profile": "reference",
"tag": "token",
"text": "string",
"type": "special",
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"partof": "reference",
"phonetic": "string",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -82,6 +82,7 @@ func (s *FhirOrganizationAffiliation) GetSearchParameters() map[string]string {
"date": "date",
"email": "token",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
@ -93,6 +94,10 @@ func (s *FhirOrganizationAffiliation) GetSearchParameters() map[string]string {
"profile": "reference",
"role": "token",
"service": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token",
"tag": "token",
"telecom": "token",

View File

@ -198,34 +198,39 @@ type FhirPatient struct {
func (s *FhirPatient) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"deathDate": "date",
"deceased": "token",
"email": "token",
"family": "string",
"gender": "token",
"generalPractitioner": "reference",
"given": "string",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"link": "reference",
"name": "string",
"organization": "reference",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"deathDate": "date",
"deceased": "token",
"email": "token",
"family": "string",
"gender": "token",
"generalPractitioner": "reference",
"given": "string",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"link": "reference",
"name": "string",
"organization": "reference",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -176,30 +176,35 @@ type FhirPerson struct {
func (s *FhirPerson) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"email": "token",
"gender": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"link": "reference",
"name": "string",
"organization": "reference",
"phone": "token",
"phonetic": "string",
"practitioner": "reference",
"profile": "reference",
"relatedperson": "reference",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"email": "token",
"gender": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"link": "reference",
"name": "string",
"organization": "reference",
"phone": "token",
"phonetic": "string",
"practitioner": "reference",
"profile": "reference",
"relatedperson": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -177,29 +177,34 @@ type FhirPractitioner struct {
func (s *FhirPractitioner) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"communication": "token",
"email": "token",
"family": "string",
"gender": "token",
"given": "string",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"communication": "token",
"email": "token",
"family": "string",
"gender": "token",
"given": "string",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -99,25 +99,30 @@ type FhirPractitionerRole struct {
func (s *FhirPractitionerRole) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"date": "date",
"email": "token",
"endpoint": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"organization": "reference",
"phone": "token",
"practitioner": "reference",
"profile": "reference",
"role": "token",
"service": "reference",
"specialty": "token",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
"active": "token",
"date": "date",
"email": "token",
"endpoint": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"organization": "reference",
"phone": "token",
"practitioner": "reference",
"profile": "reference",
"role": "token",
"service": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -171,6 +171,7 @@ func (s *FhirProcedure) GetSearchParameters() map[string]string {
"code": "token",
"date": "date",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -182,6 +183,10 @@ func (s *FhirProcedure) GetSearchParameters() map[string]string {
"profile": "reference",
"reasonCode": "token",
"reasonReference": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",

View File

@ -63,21 +63,26 @@ type FhirProvenance struct {
func (s *FhirProvenance) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"agent": "reference",
"agentRole": "token",
"agentType": "token",
"entity": "reference",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"profile": "reference",
"recorded": "date",
"signatureType": "token",
"tag": "token",
"target": "reference",
"text": "string",
"type": "special",
"when": "date",
"agent": "reference",
"agentRole": "token",
"agentType": "token",
"entity": "reference",
"id": "keyword",
"language": "token",
"lastUpdated": "date",
"location": "reference",
"profile": "reference",
"recorded": "date",
"signatureType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"target": "reference",
"text": "string",
"type": "special",
"when": "date",
}
return searchParameters
}

View File

@ -87,29 +87,34 @@ type FhirQuestionnaire struct {
func (s *FhirQuestionnaire) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"code": "token",
"context": "token",
"contextQuantity": "quantity",
"contextType": "token",
"date": "date",
"definition": "uri",
"description": "string",
"effective": "date",
"identifier": "token",
"jurisdiction": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"profile": "reference",
"publisher": "string",
"status": "token",
"subjectType": "token",
"tag": "token",
"text": "string",
"title": "string",
"type": "special",
"url": "uri",
"version": "token",
"code": "token",
"context": "token",
"contextQuantity": "quantity",
"contextType": "token",
"date": "date",
"definition": "uri",
"description": "string",
"effective": "date",
"id": "keyword",
"identifier": "token",
"jurisdiction": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"profile": "reference",
"publisher": "string",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subjectType": "token",
"tag": "token",
"text": "string",
"title": "string",
"type": "special",
"url": "uri",
"version": "token",
}
return searchParameters
}

View File

@ -66,22 +66,27 @@ type FhirQuestionnaireResponse struct {
func (s *FhirQuestionnaireResponse) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"author": "reference",
"authored": "date",
"basedOn": "reference",
"encounter": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"partOf": "reference",
"profile": "reference",
"questionnaire": "reference",
"source": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"author": "reference",
"authored": "date",
"basedOn": "reference",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"partOf": "reference",
"profile": "reference",
"questionnaire": "reference",
"source": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -170,28 +170,33 @@ type FhirRelatedPerson struct {
func (s *FhirRelatedPerson) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"email": "token",
"gender": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"relationship": "token",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
"active": "token",
"address": "string",
"addressCity": "string",
"addressCountry": "string",
"addressPostalcode": "string",
"addressState": "string",
"addressUse": "token",
"birthdate": "date",
"email": "token",
"gender": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"name": "string",
"phone": "token",
"phonetic": "string",
"profile": "reference",
"relationship": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token",
"telecom": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -57,19 +57,24 @@ type FhirSchedule struct {
func (s *FhirSchedule) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"active": "token",
"actor": "reference",
"date": "date",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"serviceCategory": "token",
"serviceType": "token",
"specialty": "token",
"tag": "token",
"text": "string",
"type": "special",
"active": "token",
"actor": "reference",
"date": "date",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"serviceCategory": "token",
"serviceType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -167,6 +167,7 @@ func (s *FhirServiceRequest) GetSearchParameters() map[string]string {
"category": "token",
"code": "token",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"instantiatesCanonical": "reference",
"instantiatesUri": "uri",
@ -181,6 +182,10 @@ func (s *FhirServiceRequest) GetSearchParameters() map[string]string {
"replaces": "reference",
"requester": "reference",
"requisition": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specimen": "reference",
"status": "token",
"subject": "reference",

View File

@ -60,20 +60,25 @@ type FhirSlot struct {
func (s *FhirSlot) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"appointmentType": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"schedule": "reference",
"serviceCategory": "token",
"serviceType": "token",
"specialty": "token",
"start": "date",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"appointmentType": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"profile": "reference",
"schedule": "reference",
"serviceCategory": "token",
"serviceType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token",
"start": "date",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -66,22 +66,27 @@ type FhirSpecimen struct {
func (s *FhirSpecimen) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"accession": "token",
"bodysite": "token",
"collected": "date",
"collector": "reference",
"container": "token",
"containerId": "token",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"parent": "reference",
"profile": "reference",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
"accession": "token",
"bodysite": "token",
"collected": "date",
"collector": "reference",
"container": "token",
"containerId": "token",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"parent": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"subject": "reference",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -99,17 +99,22 @@ type FhirVisionPrescription struct {
func (s *FhirVisionPrescription) GetSearchParameters() map[string]string {
searchParameters := map[string]string{
"datewritten": "date",
"encounter": "reference",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"prescriber": "reference",
"profile": "reference",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
"datewritten": "date",
"encounter": "reference",
"id": "keyword",
"identifier": "token",
"language": "token",
"lastUpdated": "date",
"prescriber": "reference",
"profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token",
"tag": "token",
"text": "string",
"type": "special",
}
return searchParameters
}

View File

@ -203,6 +203,13 @@ func main() {
fieldNameLowerCamel := strcase.ToLowerCamel(fieldName)
d[jen.Lit(fieldNameLowerCamel)] = jen.Lit(fieldInfo.FieldType)
}
d[jen.Lit("id")] = jen.Lit("keyword")
d[jen.Lit("source_id")] = jen.Lit("keyword")
d[jen.Lit("source_uri")] = jen.Lit("keyword")
d[jen.Lit("source_resource_id")] = jen.Lit("keyword")
d[jen.Lit("source_resource_type")] = jen.Lit("keyword")
}))
g.Return(jen.Id("searchParameters"))
})

View File

@ -157,9 +157,9 @@
"select": [],
"from": "Immunization",
"where": {},
"aggregation_params":["resourceType"],
"aggregation_type":"countBy"
"aggregations":{
"count_by": "*"
}
}
},
{
@ -170,9 +170,9 @@
"select": [],
"from": "Claim",
"where": {},
"aggregation_params":["resourceType"],
"aggregation_type":"countBy"
"aggregations":{
"count_by": "*"
}
}
}],
"parsing": {

View File

@ -8,37 +8,53 @@ import * as _ from 'lodash';
export class DatasetLatestEntryPipe implements PipeTransform {
transform(dataset: ChartDataset<'line'>, round?: number, valLookupKey?: string, unitLookupKey?: string): string {
if(!round){
round = 0 //round to nearest whole number
}
let lastItem = dataset?.data?.[dataset?.data?.length -1] || ''
// let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key']
console.log('latestEntryConfig', lastItem, valLookupKey, unitLookupKey, round)
let lastItemUnit = ""
let lastItemValue
if(Array.isArray(lastItem)){
lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string
lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string
} else if(typeof lastItem === 'object'){
console.log('lastItem-object', lastItem?.[valLookupKey])
lastItemValue = lastItem?.[valLookupKey]
lastItemUnit = lastItem?.[unitLookupKey]
} else {
//do nothing
if(!dataset) {
return '--'
}
lastItemValue = this.roundToDecimalPlaces(lastItemValue, round)
if(lastItemUnit){
return lastItemValue + ' ' + lastItemUnit
} else {
return lastItemValue.toString()
try{
if (!round) {
round = 0 //round to nearest whole number
}
let lastItem = dataset?.data?.[dataset?.data?.length - 1] || ''
// let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key']
console.log('latestEntryConfig', lastItem, valLookupKey, unitLookupKey, round)
let lastItemUnit = ""
let lastItemValue
if (Array.isArray(lastItem)) {
lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string
lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string
} else if (typeof lastItem === 'object') {
console.log('lastItem-object', lastItem?.[valLookupKey])
lastItemValue = lastItem?.[valLookupKey]
lastItemUnit = lastItem?.[unitLookupKey]
} else {
//do nothing
}
lastItemValue = this.roundToDecimalPlaces(lastItemValue, round)
if (lastItemUnit) {
return lastItemValue + ' ' + lastItemUnit
} else {
return lastItemValue.toString()
}
}
catch (e) {
return '--'
}
}
roundToDecimalPlaces(value: string, decimalPlaces: number): string {
return parseFloat(value).toFixed(decimalPlaces).toString()
if(!value) {
return '--'
}
try{
return parseFloat(value).toFixed(decimalPlaces).toString()
} catch (e) {
return '--'
}
}
}

View File

@ -22,7 +22,7 @@
</div>
<div>
<label>{{chartDataset.label}}</label>
<h4>3</h4>
<h4>{{chartDataset | datasetLatestEntry: 0:'value' }}</h4>
</div>
</div>
</div><!-- col -->

View File

@ -5,10 +5,11 @@ import {DashboardWidgetComponent} from '../dashboard-widget/dashboard-widget.com
import {ChartConfiguration} from 'chart.js/dist/types';
import {LoadingWidgetComponent} from '../loading-widget/loading-widget.component';
import {EmptyWidgetComponent} from '../empty-widget/empty-widget.component';
import {PipesModule} from '../../pipes/pipes.module';
@Component({
standalone: true,
imports: [NgChartsModule,CommonModule, LoadingWidgetComponent, EmptyWidgetComponent],
imports: [NgChartsModule,CommonModule, LoadingWidgetComponent, EmptyWidgetComponent, PipesModule],
selector: 'dual-gauges-widget',
templateUrl: './dual-gauges-widget.component.html',
styleUrls: ['./dual-gauges-widget.component.scss']