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" SearchParameterTypeQuantity SearchParameterType = "quantity"
SearchParameterTypeComposite SearchParameterType = "composite" SearchParameterTypeComposite SearchParameterType = "composite"
SearchParameterTypeSpecial SearchParameterType = "special" SearchParameterTypeSpecial SearchParameterType = "special"
SearchParameterTypeKeyword SearchParameterType = "keyword" //this is a literal/string primitive.
) )
const TABLE_ALIAS = "fhir" 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 //populate the group by and order by clause with the count by values
query.Aggregations.OrderBy = "count(*) DESC" query.Aggregations.OrderBy = "count(*) DESC"
query.Aggregations.GroupBy = query.Aggregations.CountBy 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 //process order by clause
@ -322,7 +331,7 @@ func ProcessSearchParameterValue(searchParameter SearchParameter, searchValueWit
SecondaryValues: map[string]interface{}{}, SecondaryValues: map[string]interface{}{},
Value: searchValueWithPrefix, 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) 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 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: case SearchParameterTypeReference:
return "", nil, fmt.Errorf("search parameter type %s not supported", searchParam.Type) 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 //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 { if len(aggregationParameter.Modifier) > 0 {
return aggregationParameter, fmt.Errorf("primitive aggregation parameter %s cannot have a property (%s)", aggregationParameter.Name, aggregationParameter.Modifier) 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() { func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexOrderByAggregation() {
//setup //setup
sqliteRepo := suite.TestRepository.(*SqliteRepository) 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() { func (suite *RepositorySqlTestSuite) TestQueryResources_SQL_WithComplexCountByAggregation() {
//setup //setup
sqliteRepo := suite.TestRepository.(*SqliteRepository) 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: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 {"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}, {"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", 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}, {"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: ""}, "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: ""}, "5.4||", SearchParameterValue{Value: float64(5.4), Prefix: "", SecondaryValues: map[string]interface{}{}}, false},
{SearchParameter{Type: "quantity", Name: "valueQuantity", Modifier: ""}, "", SearchParameterValue{}, true}, {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 //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{}{"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: "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: "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 //test && assert
@ -181,6 +186,7 @@ func TestSearchCodeToFromClause(t *testing.T) {
}{ }{
{SearchParameter{Type: "number", Name: "probability", Modifier: ""}, "", false}, {SearchParameter{Type: "number", Name: "probability", Modifier: ""}, "", false},
{SearchParameter{Type: "date", Name: "issueDate", 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}, {SearchParameter{Type: "token", Name: "hello", Modifier: ""}, "json_each(fhir.hello) as helloJson", false},
} }

View File

@ -54,6 +54,7 @@ type FhirAccount struct {
func (s *FhirAccount) GetSearchParameters() map[string]string { func (s *FhirAccount) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -61,6 +62,10 @@ func (s *FhirAccount) GetSearchParameters() map[string]string {
"owner": "reference", "owner": "reference",
"period": "date", "period": "date",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -76,6 +76,7 @@ func (s *FhirAdverseEvent) GetSearchParameters() map[string]string {
"category": "token", "category": "token",
"date": "date", "date": "date",
"event": "token", "event": "token",
"id": "keyword",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"location": "reference", "location": "reference",
@ -84,6 +85,10 @@ func (s *FhirAdverseEvent) GetSearchParameters() map[string]string {
"resultingcondition": "reference", "resultingcondition": "reference",
"seriousness": "token", "seriousness": "token",
"severity": "token", "severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"study": "reference", "study": "reference",
"subject": "reference", "subject": "reference",
"substance": "reference", "substance": "reference",

View File

@ -154,6 +154,7 @@ func (s *FhirAllergyIntolerance) GetSearchParameters() map[string]string {
"code": "token", "code": "token",
"criticality": "token", "criticality": "token",
"date": "date", "date": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastDate": "date", "lastDate": "date",
@ -164,6 +165,10 @@ func (s *FhirAllergyIntolerance) GetSearchParameters() map[string]string {
"recorder": "reference", "recorder": "reference",
"route": "token", "route": "token",
"severity": "token", "severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"text": "string", "text": "string",
"type": "special", "type": "special",

View File

@ -88,6 +88,7 @@ func (s *FhirAppointment) GetSearchParameters() map[string]string {
"appointmentType": "token", "appointmentType": "token",
"basedOn": "reference", "basedOn": "reference",
"date": "date", "date": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -100,6 +101,10 @@ func (s *FhirAppointment) GetSearchParameters() map[string]string {
"serviceCategory": "token", "serviceCategory": "token",
"serviceType": "token", "serviceType": "token",
"slot": "reference", "slot": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token", "specialty": "token",
"status": "token", "status": "token",
"supportingInfo": "reference", "supportingInfo": "reference",

View File

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

View File

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

View File

@ -113,11 +113,16 @@ func (s *FhirCareTeam) GetSearchParameters() map[string]string {
"category": "token", "category": "token",
"date": "date", "date": "date",
"encounter": "reference", "encounter": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"participant": "reference", "participant": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -90,6 +90,7 @@ func (s *FhirClaim) GetSearchParameters() map[string]string {
"encounter": "reference", "encounter": "reference",
"enterer": "reference", "enterer": "reference",
"facility": "reference", "facility": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"insurer": "reference", "insurer": "reference",
"itemUdi": "reference", "itemUdi": "reference",
@ -100,6 +101,10 @@ func (s *FhirClaim) GetSearchParameters() map[string]string {
"procedureUdi": "reference", "procedureUdi": "reference",
"profile": "reference", "profile": "reference",
"provider": "reference", "provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subdetailUdi": "reference", "subdetailUdi": "reference",
"tag": "token", "tag": "token",

View File

@ -68,6 +68,7 @@ func (s *FhirClaimResponse) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"created": "date", "created": "date",
"disposition": "string", "disposition": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"insurer": "reference", "insurer": "reference",
"language": "token", "language": "token",
@ -77,6 +78,10 @@ func (s *FhirClaimResponse) GetSearchParameters() map[string]string {
"profile": "reference", "profile": "reference",
"request": "reference", "request": "reference",
"requestor": "reference", "requestor": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -160,6 +160,7 @@ func (s *FhirComposition) GetSearchParameters() map[string]string {
"date": "date", "date": "date",
"encounter": "reference", "encounter": "reference",
"entry": "reference", "entry": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -168,6 +169,10 @@ func (s *FhirComposition) GetSearchParameters() map[string]string {
"relatedId": "token", "relatedId": "token",
"relatedRef": "reference", "relatedRef": "reference",
"section": "token", "section": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -157,6 +157,7 @@ func (s *FhirCondition) GetSearchParameters() map[string]string {
"encounter": "reference", "encounter": "reference",
"evidence": "token", "evidence": "token",
"evidenceDetail": "reference", "evidenceDetail": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -166,6 +167,10 @@ func (s *FhirCondition) GetSearchParameters() map[string]string {
"profile": "reference", "profile": "reference",
"recordedDate": "date", "recordedDate": "date",
"severity": "token", "severity": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"stage": "token", "stage": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -137,6 +137,7 @@ func (s *FhirConsent) GetSearchParameters() map[string]string {
"consentor": "reference", "consentor": "reference",
"data": "reference", "data": "reference",
"date": "date", "date": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -147,6 +148,10 @@ func (s *FhirConsent) GetSearchParameters() map[string]string {
"scope": "token", "scope": "token",
"securityLabel": "token", "securityLabel": "token",
"sourceReference": "reference", "sourceReference": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -67,12 +67,17 @@ func (s *FhirCoverage) GetSearchParameters() map[string]string {
"classType": "token", "classType": "token",
"classValue": "string", "classValue": "string",
"dependent": "string", "dependent": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"payor": "reference", "payor": "reference",
"policyHolder": "reference", "policyHolder": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subscriber": "reference", "subscriber": "reference",
"tag": "token", "tag": "token",

View File

@ -57,11 +57,16 @@ func (s *FhirCoverageEligibilityRequest) GetSearchParameters() map[string]string
"created": "date", "created": "date",
"enterer": "reference", "enterer": "reference",
"facility": "reference", "facility": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"profile": "reference", "profile": "reference",
"provider": "reference", "provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -62,6 +62,7 @@ func (s *FhirCoverageEligibilityResponse) GetSearchParameters() map[string]strin
searchParameters := map[string]string{ searchParameters := map[string]string{
"created": "date", "created": "date",
"disposition": "string", "disposition": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"insurer": "reference", "insurer": "reference",
"language": "token", "language": "token",
@ -70,6 +71,10 @@ func (s *FhirCoverageEligibilityResponse) GetSearchParameters() map[string]strin
"profile": "reference", "profile": "reference",
"request": "reference", "request": "reference",
"requestor": "reference", "requestor": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -67,6 +67,7 @@ type FhirDevice struct {
func (s *FhirDevice) GetSearchParameters() map[string]string { func (s *FhirDevice) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"deviceName": "string", "deviceName": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -75,6 +76,10 @@ func (s *FhirDevice) GetSearchParameters() map[string]string {
"model": "string", "model": "string",
"organization": "reference", "organization": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

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

View File

@ -172,6 +172,7 @@ func (s *FhirDiagnosticReport) GetSearchParameters() map[string]string {
"conclusion": "token", "conclusion": "token",
"date": "date", "date": "date",
"encounter": "reference", "encounter": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"issued": "date", "issued": "date",
"language": "token", "language": "token",
@ -181,6 +182,10 @@ func (s *FhirDiagnosticReport) GetSearchParameters() map[string]string {
"profile": "reference", "profile": "reference",
"result": "reference", "result": "reference",
"resultsInterpreter": "reference", "resultsInterpreter": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specimen": "reference", "specimen": "reference",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",

View File

@ -105,6 +105,7 @@ func (s *FhirDocumentManifest) GetSearchParameters() map[string]string {
"author": "reference", "author": "reference",
"created": "date", "created": "date",
"description": "string", "description": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"item": "reference", "item": "reference",
"language": "token", "language": "token",
@ -114,6 +115,10 @@ func (s *FhirDocumentManifest) GetSearchParameters() map[string]string {
"relatedId": "token", "relatedId": "token",
"relatedRef": "reference", "relatedRef": "reference",
"source": "uri", "source": "uri",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -158,6 +158,7 @@ func (s *FhirDocumentReference) GetSearchParameters() map[string]string {
"event": "token", "event": "token",
"facility": "token", "facility": "token",
"format": "token", "format": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -169,6 +170,10 @@ func (s *FhirDocumentReference) GetSearchParameters() map[string]string {
"relation": "token", "relation": "token",
"securityLabel": "token", "securityLabel": "token",
"setting": "token", "setting": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -159,6 +159,7 @@ func (s *FhirEncounter) GetSearchParameters() map[string]string {
"date": "date", "date": "date",
"diagnosis": "reference", "diagnosis": "reference",
"episodeOfCare": "reference", "episodeOfCare": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -173,6 +174,10 @@ func (s *FhirEncounter) GetSearchParameters() map[string]string {
"reasonCode": "token", "reasonCode": "token",
"reasonReference": "reference", "reasonReference": "reference",
"serviceProvider": "reference", "serviceProvider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialArrangement": "token", "specialArrangement": "token",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",

View File

@ -55,6 +55,7 @@ type FhirEndpoint struct {
func (s *FhirEndpoint) GetSearchParameters() map[string]string { func (s *FhirEndpoint) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"connectionType": "token", "connectionType": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -62,6 +63,10 @@ func (s *FhirEndpoint) GetSearchParameters() map[string]string {
"organization": "reference", "organization": "reference",
"payloadType": "token", "payloadType": "token",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

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

View File

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

View File

@ -93,6 +93,7 @@ func (s *FhirExplanationOfBenefit) GetSearchParameters() map[string]string {
"encounter": "reference", "encounter": "reference",
"enterer": "reference", "enterer": "reference",
"facility": "reference", "facility": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"itemUdi": "reference", "itemUdi": "reference",
"language": "token", "language": "token",
@ -101,6 +102,10 @@ func (s *FhirExplanationOfBenefit) GetSearchParameters() map[string]string {
"procedureUdi": "reference", "procedureUdi": "reference",
"profile": "reference", "profile": "reference",
"provider": "reference", "provider": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subdetailUdi": "reference", "subdetailUdi": "reference",
"tag": "token", "tag": "token",

View File

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

View File

@ -92,11 +92,16 @@ func (s *FhirGoal) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"achievementStatus": "token", "achievementStatus": "token",
"category": "token", "category": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"lifecycleStatus": "token", "lifecycleStatus": "token",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"startDate": "date", "startDate": "date",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -122,6 +122,7 @@ func (s *FhirImagingStudy) GetSearchParameters() map[string]string {
"dicomClass": "token", "dicomClass": "token",
"encounter": "reference", "encounter": "reference",
"endpoint": "reference", "endpoint": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"instance": "token", "instance": "token",
"interpreter": "reference", "interpreter": "reference",
@ -133,6 +134,10 @@ func (s *FhirImagingStudy) GetSearchParameters() map[string]string {
"reason": "token", "reason": "token",
"referrer": "reference", "referrer": "reference",
"series": "token", "series": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"started": "date", "started": "date",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",

View File

@ -135,6 +135,7 @@ type FhirImmunization struct {
func (s *FhirImmunization) GetSearchParameters() map[string]string { func (s *FhirImmunization) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"date": "date", "date": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -148,6 +149,10 @@ func (s *FhirImmunization) GetSearchParameters() map[string]string {
"reasonCode": "token", "reasonCode": "token",
"reasonReference": "reference", "reasonReference": "reference",
"series": "string", "series": "string",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"statusReason": "token", "statusReason": "token",
"tag": "token", "tag": "token",

View File

@ -83,6 +83,7 @@ func (s *FhirInsurancePlan) GetSearchParameters() map[string]string {
"addressUse": "token", "addressUse": "token",
"administeredBy": "reference", "administeredBy": "reference",
"endpoint": "reference", "endpoint": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -90,6 +91,10 @@ func (s *FhirInsurancePlan) GetSearchParameters() map[string]string {
"ownedBy": "reference", "ownedBy": "reference",
"phonetic": "string", "phonetic": "string",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -82,6 +82,7 @@ func (s *FhirLocation) GetSearchParameters() map[string]string {
"addressState": "string", "addressState": "string",
"addressUse": "token", "addressUse": "token",
"endpoint": "reference", "endpoint": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -90,6 +91,10 @@ func (s *FhirLocation) GetSearchParameters() map[string]string {
"organization": "reference", "organization": "reference",
"partof": "reference", "partof": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -73,6 +73,7 @@ func (s *FhirMedia) GetSearchParameters() map[string]string {
"created": "date", "created": "date",
"device": "reference", "device": "reference",
"encounter": "reference", "encounter": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -80,6 +81,10 @@ func (s *FhirMedia) GetSearchParameters() map[string]string {
"operator": "reference", "operator": "reference",
"profile": "reference", "profile": "reference",
"site": "token", "site": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -83,6 +83,7 @@ func (s *FhirMedication) GetSearchParameters() map[string]string {
"code": "token", "code": "token",
"expirationDate": "date", "expirationDate": "date",
"form": "token", "form": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"ingredient": "reference", "ingredient": "reference",
"ingredientCode": "token", "ingredientCode": "token",
@ -91,6 +92,10 @@ func (s *FhirMedication) GetSearchParameters() map[string]string {
"lotNumber": "token", "lotNumber": "token",
"manufacturer": "reference", "manufacturer": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -140,6 +140,7 @@ func (s *FhirMedicationAdministration) GetSearchParameters() map[string]string {
"context": "reference", "context": "reference",
"device": "reference", "device": "reference",
"effectiveTime": "date", "effectiveTime": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -149,6 +150,10 @@ func (s *FhirMedicationAdministration) GetSearchParameters() map[string]string {
"reasonGiven": "token", "reasonGiven": "token",
"reasonNotGiven": "token", "reasonNotGiven": "token",
"request": "reference", "request": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -146,6 +146,7 @@ func (s *FhirMedicationDispense) GetSearchParameters() map[string]string {
"code": "token", "code": "token",
"context": "reference", "context": "reference",
"destination": "reference", "destination": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -155,6 +156,10 @@ func (s *FhirMedicationDispense) GetSearchParameters() map[string]string {
"profile": "reference", "profile": "reference",
"receiver": "reference", "receiver": "reference",
"responsibleparty": "reference", "responsibleparty": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

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

View File

@ -134,6 +134,7 @@ func (s *FhirMedicationStatement) GetSearchParameters() map[string]string {
"code": "token", "code": "token",
"context": "reference", "context": "reference",
"effective": "date", "effective": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -141,6 +142,10 @@ func (s *FhirMedicationStatement) GetSearchParameters() map[string]string {
"partOf": "reference", "partOf": "reference",
"profile": "reference", "profile": "reference",
"source": "reference", "source": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

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

View File

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

View File

@ -80,6 +80,7 @@ func (s *FhirOrganization) GetSearchParameters() map[string]string {
"addressState": "string", "addressState": "string",
"addressUse": "token", "addressUse": "token",
"endpoint": "reference", "endpoint": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -87,6 +88,10 @@ func (s *FhirOrganization) GetSearchParameters() map[string]string {
"partof": "reference", "partof": "reference",
"phonetic": "string", "phonetic": "string",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"text": "string", "text": "string",
"type": "special", "type": "special",

View File

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

View File

@ -213,6 +213,7 @@ func (s *FhirPatient) GetSearchParameters() map[string]string {
"gender": "token", "gender": "token",
"generalPractitioner": "reference", "generalPractitioner": "reference",
"given": "string", "given": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -222,6 +223,10 @@ func (s *FhirPatient) GetSearchParameters() map[string]string {
"phone": "token", "phone": "token",
"phonetic": "string", "phonetic": "string",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"telecom": "token", "telecom": "token",
"text": "string", "text": "string",

View File

@ -185,6 +185,7 @@ func (s *FhirPerson) GetSearchParameters() map[string]string {
"birthdate": "date", "birthdate": "date",
"email": "token", "email": "token",
"gender": "token", "gender": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -196,6 +197,10 @@ func (s *FhirPerson) GetSearchParameters() map[string]string {
"practitioner": "reference", "practitioner": "reference",
"profile": "reference", "profile": "reference",
"relatedperson": "reference", "relatedperson": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"telecom": "token", "telecom": "token",
"text": "string", "text": "string",

View File

@ -189,6 +189,7 @@ func (s *FhirPractitioner) GetSearchParameters() map[string]string {
"family": "string", "family": "string",
"gender": "token", "gender": "token",
"given": "string", "given": "string",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -196,6 +197,10 @@ func (s *FhirPractitioner) GetSearchParameters() map[string]string {
"phone": "token", "phone": "token",
"phonetic": "string", "phonetic": "string",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"telecom": "token", "telecom": "token",
"text": "string", "text": "string",

View File

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

View File

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

View File

@ -67,12 +67,17 @@ func (s *FhirProvenance) GetSearchParameters() map[string]string {
"agentRole": "token", "agentRole": "token",
"agentType": "token", "agentType": "token",
"entity": "reference", "entity": "reference",
"id": "keyword",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"location": "reference", "location": "reference",
"profile": "reference", "profile": "reference",
"recorded": "date", "recorded": "date",
"signatureType": "token", "signatureType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"target": "reference", "target": "reference",
"text": "string", "text": "string",

View File

@ -95,6 +95,7 @@ func (s *FhirQuestionnaire) GetSearchParameters() map[string]string {
"definition": "uri", "definition": "uri",
"description": "string", "description": "string",
"effective": "date", "effective": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"jurisdiction": "token", "jurisdiction": "token",
"language": "token", "language": "token",
@ -102,6 +103,10 @@ func (s *FhirQuestionnaire) GetSearchParameters() map[string]string {
"name": "string", "name": "string",
"profile": "reference", "profile": "reference",
"publisher": "string", "publisher": "string",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subjectType": "token", "subjectType": "token",
"tag": "token", "tag": "token",

View File

@ -70,6 +70,7 @@ func (s *FhirQuestionnaireResponse) GetSearchParameters() map[string]string {
"authored": "date", "authored": "date",
"basedOn": "reference", "basedOn": "reference",
"encounter": "reference", "encounter": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -77,6 +78,10 @@ func (s *FhirQuestionnaireResponse) GetSearchParameters() map[string]string {
"profile": "reference", "profile": "reference",
"questionnaire": "reference", "questionnaire": "reference",
"source": "reference", "source": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -180,6 +180,7 @@ func (s *FhirRelatedPerson) GetSearchParameters() map[string]string {
"birthdate": "date", "birthdate": "date",
"email": "token", "email": "token",
"gender": "token", "gender": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -188,6 +189,10 @@ func (s *FhirRelatedPerson) GetSearchParameters() map[string]string {
"phonetic": "string", "phonetic": "string",
"profile": "reference", "profile": "reference",
"relationship": "token", "relationship": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"tag": "token", "tag": "token",
"telecom": "token", "telecom": "token",
"text": "string", "text": "string",

View File

@ -60,12 +60,17 @@ func (s *FhirSchedule) GetSearchParameters() map[string]string {
"active": "token", "active": "token",
"actor": "reference", "actor": "reference",
"date": "date", "date": "date",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"profile": "reference", "profile": "reference",
"serviceCategory": "token", "serviceCategory": "token",
"serviceType": "token", "serviceType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token", "specialty": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

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

View File

@ -61,6 +61,7 @@ type FhirSlot struct {
func (s *FhirSlot) GetSearchParameters() map[string]string { func (s *FhirSlot) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"appointmentType": "token", "appointmentType": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
@ -68,6 +69,10 @@ func (s *FhirSlot) GetSearchParameters() map[string]string {
"schedule": "reference", "schedule": "reference",
"serviceCategory": "token", "serviceCategory": "token",
"serviceType": "token", "serviceType": "token",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"specialty": "token", "specialty": "token",
"start": "date", "start": "date",
"status": "token", "status": "token",

View File

@ -72,11 +72,16 @@ func (s *FhirSpecimen) GetSearchParameters() map[string]string {
"collector": "reference", "collector": "reference",
"container": "token", "container": "token",
"containerId": "token", "containerId": "token",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"parent": "reference", "parent": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"subject": "reference", "subject": "reference",
"tag": "token", "tag": "token",

View File

@ -101,11 +101,16 @@ func (s *FhirVisionPrescription) GetSearchParameters() map[string]string {
searchParameters := map[string]string{ searchParameters := map[string]string{
"datewritten": "date", "datewritten": "date",
"encounter": "reference", "encounter": "reference",
"id": "keyword",
"identifier": "token", "identifier": "token",
"language": "token", "language": "token",
"lastUpdated": "date", "lastUpdated": "date",
"prescriber": "reference", "prescriber": "reference",
"profile": "reference", "profile": "reference",
"source_id": "keyword",
"source_resource_id": "keyword",
"source_resource_type": "keyword",
"source_uri": "keyword",
"status": "token", "status": "token",
"tag": "token", "tag": "token",
"text": "string", "text": "string",

View File

@ -203,6 +203,13 @@ func main() {
fieldNameLowerCamel := strcase.ToLowerCamel(fieldName) fieldNameLowerCamel := strcase.ToLowerCamel(fieldName)
d[jen.Lit(fieldNameLowerCamel)] = jen.Lit(fieldInfo.FieldType) 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")) g.Return(jen.Id("searchParameters"))
}) })

View File

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

View File

@ -8,6 +8,11 @@ import * as _ from 'lodash';
export class DatasetLatestEntryPipe implements PipeTransform { export class DatasetLatestEntryPipe implements PipeTransform {
transform(dataset: ChartDataset<'line'>, round?: number, valLookupKey?: string, unitLookupKey?: string): string { transform(dataset: ChartDataset<'line'>, round?: number, valLookupKey?: string, unitLookupKey?: string): string {
if(!dataset) {
return '--'
}
try{
if (!round) { if (!round) {
round = 0 //round to nearest whole number round = 0 //round to nearest whole number
} }
@ -35,10 +40,21 @@ export class DatasetLatestEntryPipe implements PipeTransform {
return lastItemValue.toString() return lastItemValue.toString()
} }
} }
catch (e) {
return '--'
}
}
roundToDecimalPlaces(value: string, decimalPlaces: number): string { roundToDecimalPlaces(value: string, decimalPlaces: number): string {
if(!value) {
return '--'
}
try{
return parseFloat(value).toFixed(decimalPlaces).toString() return parseFloat(value).toFixed(decimalPlaces).toString()
} catch (e) {
return '--'
}
} }
} }

View File

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

View File

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