Skip to content

Commit

Permalink
Added data provenance to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
james-cockayne-ad committed Dec 1, 2023
1 parent 29f0dc5 commit 93d8452
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions OmopTransformer/COSD/Demographics/CosdDemographics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace OmopTransformer.COSD.Demographics;

[Description("COSD Demographics")]
[SourceQuery("OmopDemographics.xml")]
internal class CosdDemographics
{
Expand Down
9 changes: 9 additions & 0 deletions OmopTransformer/Documentation/DocumentationRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ private void RenderProperty(Type mapperType, PropertyInfo property, StringBuilde
if (attributes.Any())
{
stringBuilder.AppendLine($"### {property.Name}");

var sourceType = GetOmopSourceType(mapperType);

var description = sourceType.GetCustomAttributes(typeof(DescriptionAttribute)).FirstOrDefault();

if (description != null)
{
stringBuilder.AppendLine($"#### {((DescriptionAttribute)description).Value}");
}
}

foreach (var attribute in attributes)
Expand Down
7 changes: 7 additions & 0 deletions transformation-documentation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
`Automatically generated documentation`

# Location
## COSD Demographics
### address_1
#### COSD Demographics
Value copied from `StreetAddressLine1`
* `StreetAddressLine1` The first element of the StructuredAddress element, within the Demographics element.
<details>
Expand Down Expand Up @@ -44,6 +46,7 @@ where
</details>

### address_2
#### COSD Demographics
Value copied from `StreetAddressLine2`
* `StreetAddressLine2` The second element of the StructuredAddress element, within the Demographics element.
<details>
Expand Down Expand Up @@ -86,6 +89,7 @@ where
</details>

### city
#### COSD Demographics
Value copied from `StreetAddressLine3`
* `StreetAddressLine3` The third element of the StructuredAddress element, within the Demographics element.
<details>
Expand Down Expand Up @@ -128,6 +132,7 @@ where
</details>

### county
#### COSD Demographics
Value copied from `StreetAddressLine4`
* `StreetAddressLine4` The fourth and final element of the StructuredAddress element, within the Demographics element.
<details>
Expand Down Expand Up @@ -170,6 +175,7 @@ where
</details>

### zip
#### COSD Demographics
Value copied from `PostcodeOfUsualAddressAtDiagnosis`
* `PostcodeOfUsualAddressAtDiagnosis` The value of the PostcodeOfUsualAddressAtDiagnosis element within the Demographics element.
<details>
Expand Down Expand Up @@ -212,6 +218,7 @@ where
</details>

### location_source_value
#### COSD Demographics
Source columns `StreetAddressLine1`, `StreetAddressLine2`, `StreetAddressLine3`, `StreetAddressLine4`, `PostcodeOfUsualAddressAtDiagnosis`.
Deliminate text with newlines.
* `StreetAddressLine1` The first element of the StructuredAddress element, within the Demographics element.
Expand Down

0 comments on commit 93d8452

Please sign in to comment.