Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Get test case 7 validating against schemas #847

Merged
merged 12 commits into from
Sep 27, 2018
5 changes: 4 additions & 1 deletion api/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ const (
LayoutStreetCity = "Street, City"
)

// Special layout flags for e-QIP integration for Country elements with CountriesNoUS type
// Special layout flags for e-QIP integration for...
const (
// Country elements with CountriesNoUS type
LayoutBirthPlaceWithoutCountyNoUS = "Birthplace without County CountriesNoUS"
LayoutBirthPlaceNoUS = "Birthplace CountriesNoUS"
// APOFPO elements
LayoutMilitaryAddress = "Military Address"
)

// Location is a basic input.
Expand Down
11 changes: 11 additions & 0 deletions api/templates/drug-used.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Derived from drug.xml -->
{{with $dt := radio .}}
{{if $dt | ne ""}}
<DrugUsed>
{{if $dt | drugType | eq "Other"}}
<Explanation>{{$dt}}</Explanation>
{{end}}
<Type>{{$dt | drugType}}</Type>
</DrugUsed>
{{end}}
{{end}}
10 changes: 10 additions & 0 deletions api/templates/drug.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{with $dt := radio .}}
{{if $dt | ne ""}}
<Drug>
{{if $dt | drugType | eq "Other"}}
<Explanation>{{$dt}}</Explanation>
{{end}}
<Type>{{$dt | drugType}}</Type>
</Drug>
{{end}}
{{end}}
2 changes: 1 addition & 1 deletion api/templates/foreign-contacts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Contact ID="{{inc $index}}">
{{if locationIsPostOffice $Item.Address}}
<APOFPO>
<Address>{{location $Item.Address}}</Address>
<Address>{{militaryAddress $Item.Address}}</Address>
<AddressComment></AddressComment>
</APOFPO>
{{else}}
Expand Down
2 changes: 1 addition & 1 deletion api/templates/foreign-travel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
VisitFamilyOrFriends="True"
{{end}}
{{if (checkboxHas $Item.Purpose "Other") | eq "True"}}
Other="Other"
Other="True"
{{end}}
/>
<Threatened>
Expand Down
6 changes: 3 additions & 3 deletions api/templates/history-employment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<WorkHours>{{radio $Item.Status}}</WorkHours>
{{- if locationIsPostOffice $Item.Address}}
<APOFPO>
<Address>{{location $Item.Address}}</Address>
<Address>{{militaryAddress $Item.Address}}</Address>
<AddressComment></AddressComment>
</APOFPO>
{{end}}
Expand Down Expand Up @@ -168,7 +168,7 @@
<Title>{{text $supervisor.Title}}</Title>
{{if locationIsPostOffice $supervisor.Address}}
<APOFPO>
<Address>{{location $supervisor.Address}}</Address>
<Address>{{militaryAddress $supervisor.Address}}</Address>
<AddressComment></AddressComment>
</APOFPO>
{{else}}
Expand All @@ -186,7 +186,7 @@
<LegalName>{{nameLastFirst $Item.ReferenceName}}</LegalName>
{{if locationIsPostOffice $Item.ReferenceAddress}}
<APOFPO>
<Address>{{location $Item.ReferenceAddress}}</Address>
<Address>{{militaryAddress $Item.ReferenceAddress}}</Address>
<AddressComment></AddressComment>
</APOFPO>
{{else}}
Expand Down
4 changes: 2 additions & 2 deletions api/templates/history-residence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Residency ID="{{inc $index}}">
{{if locationIsPostOffice $Item.Address}}
<APOFPO>
<Address>{{location $Item.Address}}</Address>
<Address>{{militaryAddress $Item.Address}}</Address>
<AddressComment>{{textarea $Item.Comments}}</AddressComment>
</APOFPO>
{{else}}
Expand All @@ -20,7 +20,7 @@
<Verifier>
{{if locationIsPostOffice $Item.ReferenceAddress}}
<APOFPO>
<Address>{{location $Item.ReferenceAddress}}</Address>
<Address>{{militaryAddress $Item.ReferenceAddress}}</Address>
<AddressComment>{{textarea $Item.Comments}}</AddressComment>
</APOFPO>
{{else}}
Expand Down
2 changes: 1 addition & 1 deletion api/templates/identification-haircolor.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<HairColor>{{ radio . }}</HairColor>
<HairColor>{{radio . | hairType}}</HairColor>
4 changes: 4 additions & 0 deletions api/templates/location-address-apofpo-state-zipcode.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Address>{{.props.street}}</Address>
<ApoFpo>{{.props.city}}</ApoFpo>
<State>{{toUpper .props.state}}</State>
<ZipCode>{{.props.zipcode}}</ZipCode>
2 changes: 1 addition & 1 deletion api/templates/relatives-and-associates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
{{if not $deceased }}
{{if locationIsPostOffice $Item.Address}}
<APOFPO>
<Address>{{location $Item.Address}}</Address>
<Address>{{militaryAddress $Item.Address}}</Address>
<AddressComment></AddressComment>
<Answer></Answer>
<AnswerComment></AnswerComment>
Expand Down
2 changes: 1 addition & 1 deletion api/templates/spouse-present-marriage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<CurrentSpouse ID="1">
{{if locationIsPostOffice $Item.Address}}
<APOFPO>
<Address>{{location $Item.Address}}</Address>
<Address>{{militaryAddress $Item.Address}}</Address>
<AddressComment></AddressComment>
<!-- TODO -->
<Answer></Answer>
Expand Down
5 changes: 1 addition & 4 deletions api/templates/substance-drug-ordered.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
<Comment></Comment>
<Explanation>{{textarea $Item.Explanation}}</Explanation>
</CounselingOrderedBy>
<Drug>
<Explanation></Explanation>
<Type>{{radio $Item.DrugType}}</Type>
</Drug>
{{tmpl "drug.xml" $Item.DrugType}}
{{if branch $Item.ActionTaken | eq "Yes"}}
<Doctor>
<Name>
Expand Down
5 changes: 1 addition & 4 deletions api/templates/substance-drug-purchase.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Activity ID="{{inc $index}}">
<Drug>
<Explanation></Explanation>
<Type>{{radio $Item.DrugType}}</Type>
</Drug>
{{tmpl "drug.xml" $Item.DrugType}}
<FirstInvolvementDate Type="{{dateEstimated $Item.FirstInvolvement}}">{{monthYear $Item.FirstInvolvement}}</FirstInvolvementDate>
<MostRecentInvolvementDate Type="{{dateEstimated $Item.RecentInvolvement}}">{{monthYear $Item.RecentInvolvement}}</MostRecentInvolvementDate>
<Nature>{{textarea $Item.NatureOfInvolvement}}</Nature>
Expand Down
5 changes: 1 addition & 4 deletions api/templates/substance-drug-usage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Instance ID="{{inc $index}}">
<DrugUsed>
<Explanation></Explanation>
<Type>{{radio $Item.DrugType}}</Type>
</DrugUsed>
{{tmpl "drug-used.xml" $Item.DrugType}}
<FirstUseDate Type="{{dateEstimated $Item.FirstUse}}">{{monthYear $Item.FirstUse}}</FirstUseDate>
<MostRecentUseDate Type="{{dateEstimated $Item.RecentUse}}">{{monthYear $Item.RecentUse}}</MostRecentUseDate>
<Nature>{{textarea $Item.NatureOfUse}}</Nature>
Expand Down
5 changes: 1 addition & 4 deletions api/templates/substance-drug-voluntary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
{{range $index, $item := .props.List.props.items}}
{{with $Item := $item.Item}}
<Consultation ID="{{inc $index}}">
<Drug>
<Type>{{radio $Item.DrugType}}</Type>
<Explanation></Explanation>
</Drug>
{{tmpl "drug.xml" $Item.DrugType}}
<Doctor>
<Name>
<Last>{{doctorLastName $Item.TreatmentProvider}}</Last>
Expand Down
4 changes: 0 additions & 4 deletions api/testdata/complete-scenarios/test5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4274,10 +4274,6 @@
<Answer MedicalProfessional="True"/>
<Explanation>Doctor said I needed to go</Explanation>
</CounselingOrderedBy>
<Drug>


</Drug>
<SuccessfullyCompletedTreatmentProgram>

</SuccessfullyCompletedTreatmentProgram>
Expand Down
Loading