Skip to content

Commit

Permalink
Adds id to generated terminology. Like with profiles, this reuses `na…
Browse files Browse the repository at this point in the history
…me` rather than introducing a new unique identifier.

PiperOrigin-RevId: 326094329
  • Loading branch information
nickgeorge committed Aug 14, 2020
1 parent c905a1b commit bf1a688
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Bundle generateTerminologies(Terminologies terminologies) {
private CodeSystem buildCodeSystem(CodeSystemConfig config) {
CodeSystem.Builder builder = CodeSystem.newBuilder();
builder.getNameBuilder().setValue(config.getName());
builder.getIdBuilder().setValue(config.getName());
builder.getTitleBuilder().setValue(config.getName());
if (!config.getDescription().isEmpty()) {
builder.getDescriptionBuilder().setValue(config.getDescription());
Expand Down Expand Up @@ -117,6 +118,7 @@ private ValueSet buildValueSet(ValueSetConfig config) {
ValueSet.Builder builder = ValueSet.newBuilder();

builder.getNameBuilder().setValue(config.getName());
builder.getIdBuilder().setValue(config.getName());
builder.getTitleBuilder().setValue(config.getName());
if (!config.getDescription().isEmpty()) {
builder.getDescriptionBuilder().setValue(config.getDescription());
Expand Down
21 changes: 14 additions & 7 deletions testdata/r4/profiles/test_terminologies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
{
"resource": {
"resourceType": "CodeSystem",
"id": "Brewery",
"url": "http://test/url/base/Brewery",
"name": "Brewery",
"title": "Brewery",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "The brewery of origin.",
"content": "complete",
Expand All @@ -36,11 +37,12 @@
{
"resource": {
"resourceType": "CodeSystem",
"id": "FootballTeams",
"url": "http://test/url/base/FootballTeams",
"name": "FootballTeams",
"title": "FootballTeams",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "NFL Football Teams",
"content": "complete",
Expand All @@ -57,11 +59,12 @@
{
"resource": {
"resourceType": "ValueSet",
"id": "Brewery",
"url": "http://test/url/base/ValueSet/Brewery",
"name": "Brewery",
"title": "Brewery",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "ValueSet for Brewery Code System.",
"compose": {
Expand All @@ -76,11 +79,12 @@
{
"resource": {
"resourceType": "ValueSet",
"id": "CaliforniaBreweries",
"url": "http://test/url/base/ValueSet/CaliforniaBreweries",
"name": "CaliforniaBreweries",
"title": "CaliforniaBreweries",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "ValueSet for California breweries.",
"compose": {
Expand All @@ -103,11 +107,12 @@
{
"resource": {
"resourceType": "ValueSet",
"id": "AmericanBreweries",
"url": "http://test/url/base/ValueSet/AmericanBreweries",
"name": "AmericanBreweries",
"title": "AmericanBreweries",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "ValueSet for Brewery Code System.",
"compose": {
Expand All @@ -132,11 +137,12 @@
{
"resource": {
"resourceType": "ValueSet",
"id": "Californians",
"url": "http://test/url/base/ValueSet/Californians",
"name": "Californians",
"title": "Californians",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "California businesses",
"compose": {
Expand Down Expand Up @@ -167,11 +173,12 @@
{
"resource": {
"resourceType": "ValueSet",
"id": "SomeSnomedCodes",
"url": "http://test/url/base/ValueSet/SomeSnomedCodes",
"name": "SomeSnomedCodes",
"title": "SomeSnomedCodes",
"status": "draft",
"date": "2020-07-29",
"date": "2020-08-04",
"publisher": "Testington Inc.",
"description": "ValueSet with codes from a CodeSystem that has a defining resource but no defined codes",
"compose": {
Expand Down
1 change: 1 addition & 0 deletions testdata/stu3/profiles/test_terminologies.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{
"resource": {
"resourceType": "CodeSystem",
"id": "Brewery",
"url": "http://test/url/base/Brewery",
"name": "Brewery",
"title": "Brewery",
Expand Down

0 comments on commit bf1a688

Please sign in to comment.