Skip to content

Commit 5394269

Browse files
authored
Fb new animal wizard dev (#259)
* Updated PDF report target * New Animal Wizard bug fixes 1. changed data types of IACUC and Account in table domain 2. updated query metadata * Lint fixes
1 parent f839d3b commit 5394269

4 files changed

Lines changed: 35 additions & 36 deletions

File tree

snprc_ehr/resources/queries/snprc_ehr/NewAnimalData.query.xml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,7 @@
8888
<fkColumnName>account</fkColumnName>
8989
</fk>
9090
</column>
91-
<column columnName="origin">
92-
<columnTitle>Origin</columnTitle>
93-
<isHidden>true</isHidden>
94-
<fk>
95-
<fkDbSchema>ehr_lookups</fkDbSchema>
96-
<fkTable>source</fkTable>
97-
<fkColumnName>code</fkColumnName>
98-
</fk>
99-
</column>
10091
<column columnName="room">
101-
<isHidden>true</isHidden>
10292
<shownInInsertView>false</shownInInsertView>
10393
<columnTitle>Room</columnTitle>
10494
<url>/ehr/cageDetails.view?
@@ -107,7 +97,7 @@
10797
<fk>
10898
<fkDbSchema>ehr_lookups</fkDbSchema>
10999
<fkTable>rooms</fkTable>
110-
<fkColumnName>room</fkColumnName>
100+
<fkColumnName>rowId</fkColumnName>
111101
</fk>
112102
</column>
113103
<column columnName="OwnerInstitution">
@@ -128,11 +118,20 @@
128118
<fkDisplayColumnName>short_name</fkDisplayColumnName>
129119
</fk>
130120
</column>
121+
<column columnName="IACUC">
122+
<datatype>varchar</datatype>
123+
<fk>
124+
<fkDbSchema>ehr</fkDbSchema>
125+
<fkTable>protocol</fkTable>
126+
<fkColumnName>protocol</fkColumnName>
127+
<fkDisplayColumnName>protocol</fkDisplayColumnName>
128+
</fk>
129+
</column>
131130
<column columnName="objectid">
132131
<isHidden>true</isHidden>
133132
</column>
134133
</columns>
135134
</table>
136135
</tables>
137136
</metadata>
138-
</query>
137+
</query>

snprc_ehr/src/client/NewAnimalPage/NewAnimalPage.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ export default class NewAnimalPage extends React.Component {
409409

410410
print = id => {
411411
// const newAnimalData = this.state.summaryData.find(o => o.id === id)
412-
const reportPath = getReportPath('BirthCertificate')
413-
const fullPath = `${reportPath}&rc:Parameters=Collapsed&Target=${id}` // &rs:Format=PDF // uncomment to print to PDF
412+
const reportPath = getReportPath('BirthRecord')
413+
const fullPath = `${reportPath}&rc:Parameters=Collapsed&TargetID=${id}` // &rs:Format=PDF // uncomment to print to PDF
414414

415415
window.open(fullPath)
416416
}
@@ -544,12 +544,12 @@ export default class NewAnimalPage extends React.Component {
544544
)}
545545

546546
{this.state.errorMessage && (
547-
<InfoPanel
548-
errorMessages={ this.state.errorMessage && [{
547+
<InfoPanel
548+
errorMessages={ this.state.errorMessage && [{
549549
propTest: true,
550550
colName: this.state.errorMessage
551551
}] }
552-
/>
552+
/>
553553
)}
554554

555555
<div>

snprc_ehr/src/client/NewAnimalPage/api/updateAnimalData.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ import { Ajax, Utils, ActionURL } from '@labkey/api'
22

33
const convertToJson = newAnimalData => {
44
const jsonData = {
5-
birthDate: `${newAnimalData.birthDate.date.toString()}`,
6-
birthCode: `${newAnimalData.bdStatus.value}`,
7-
acquisitionType: `${newAnimalData.acquisitionType.value}`,
8-
acqDate: `${newAnimalData.acqDate.date.toString()}`,
9-
gender: `${newAnimalData.gender.value}`,
10-
species: `${newAnimalData.species.value}`,
11-
animalAccount: newAnimalData.animalAccount.id,
12-
ownerInstitution: `${newAnimalData.ownerInstitution.value}`,
13-
responsibleInstitution: `${newAnimalData.responsibleInstitution.value}`,
5+
birthDate: newAnimalData.birthDate.date.toString(),
6+
birthCode: newAnimalData.bdStatus.value,
7+
acquisitionType: newAnimalData.acquisitionType.value,
8+
acqDate: newAnimalData.acqDate.date.toString(),
9+
gender: newAnimalData.gender.value,
10+
species: newAnimalData.species.value,
11+
animalAccount: newAnimalData.animalAccount.value,
12+
ownerInstitution: newAnimalData.ownerInstitution.value,
13+
responsibleInstitution: newAnimalData.responsibleInstitution.value,
1414
room: newAnimalData.room.rowId,
15-
diet: `${newAnimalData.diet.value}`,
15+
diet: newAnimalData.diet.value,
1616
...(newAnimalData.cage && { cage: newAnimalData.cage.value }),
1717
...(newAnimalData.pedigree && { pedigree: newAnimalData.pedigree.value }),
18-
...(newAnimalData.iacuc && { iacuc: newAnimalData.iacuc.id }),
18+
...(newAnimalData.iacuc && { iacuc: newAnimalData.iacuc.value }),
1919
...(newAnimalData.colony && { colony: newAnimalData.colony.value }),
2020
...(newAnimalData.sire && { sire: newAnimalData.sire.value }),
2121
...(newAnimalData.dam && { dam: newAnimalData.dam.value })

snprc_ehr/src/org/labkey/snprc_ehr/domain/NewAnimalData.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public class NewAnimalData
2727
private String _dam;
2828
private String _species;
2929
private Integer _colony;
30-
private Integer _animalAccount;
30+
private String _animalAccount;
3131
private Integer _ownerInstitution;
3232
private Integer _responsibleInstitution;
3333
private Integer _room;
3434
private Integer _cage;
3535
private Integer _diet;
3636
private Integer _pedigree;
37-
private Integer _iacuc;
37+
private String _iacuc;
3838
private Date _created;
3939
private Date _modified;
4040
private Integer _createdBy;
@@ -94,14 +94,14 @@ public NewAnimalData(Container c, User u, JSONObject json) throws RuntimeExcepti
9494
this.setDam(json.has(NEWANIMAL_DAM) && !json.isNull(NEWANIMAL_DAM) ? json.getString(NEWANIMAL_DAM) : null);
9595
this.setSpecies(json.has(NEWANIMAL_SPECIES) && !json.isNull(NEWANIMAL_SPECIES) ? json.getString(NEWANIMAL_SPECIES) : null);
9696
this.setColony(json.has(NEWANIMAL_COLONY) && !json.isNull(NEWANIMAL_COLONY) ? json.getInt(NEWANIMAL_COLONY) : null);
97-
this.setAnimalAccount(json.has(NEWANIMAL_ANIMAL_ACCOUNT) && !json.isNull(NEWANIMAL_ANIMAL_ACCOUNT) ? json.getInt(NEWANIMAL_ANIMAL_ACCOUNT) : null);
97+
this.setAnimalAccount(json.has(NEWANIMAL_ANIMAL_ACCOUNT) && !json.isNull(NEWANIMAL_ANIMAL_ACCOUNT) ? json.getString(NEWANIMAL_ANIMAL_ACCOUNT) : null);
9898
this.setOwnerInstitution(json.has(NEWANIMAL_OWNER_INSTITUTION) && !json.isNull(NEWANIMAL_OWNER_INSTITUTION) ? json.getInt(NEWANIMAL_OWNER_INSTITUTION) : null);
9999
this.setOwnerInstitution(json.has(NEWANIMAL_RESPONSIBLE_INSTITUTION) && !json.isNull(NEWANIMAL_RESPONSIBLE_INSTITUTION) ? json.getInt(NEWANIMAL_RESPONSIBLE_INSTITUTION) : null);
100100
this.setRoom(json.has(NEWANIMAL_ROOM) && !json.isNull(NEWANIMAL_ROOM) ? json.getInt(NEWANIMAL_ROOM) : null);
101101
this.setCage(json.has(NEWANIMAL_CAGE) && !json.isNull(NEWANIMAL_CAGE) ? json.getInt(NEWANIMAL_CAGE) : null);
102102
this.setDiet(json.has(NEWANIMAL_DIET) && !json.isNull(NEWANIMAL_DIET) ? json.getInt(NEWANIMAL_DIET) : null);
103103
this.setPedigree(json.has(NEWANIMAL_PEDIGREE) && !json.isNull(NEWANIMAL_PEDIGREE) ? json.getInt(NEWANIMAL_PEDIGREE) : null);
104-
this.setIacuc(json.has(NEWANIMAL_IACUC) && !json.isNull(NEWANIMAL_IACUC) ? json.getInt(NEWANIMAL_IACUC) : null);
104+
this.setIacuc(json.has(NEWANIMAL_IACUC) && !json.isNull(NEWANIMAL_IACUC) ? json.getString(NEWANIMAL_IACUC) : null);
105105
this.setObjectId(json.has(NEWANIMAL_OBJECTID) && !json.isNull(NEWANIMAL_OBJECTID) ? json.getString(NEWANIMAL_OBJECTID) : null);
106106
this.setCreatedBy(c, u, json.has(NEWANIMAL_CREATED_BY) && !json.isNull(NEWANIMAL_CREATED_BY) ? json.getInt(NEWANIMAL_CREATED_BY): null);
107107
this.setModifiedBy(c, u, json.has(NEWANIMAL_MODIFIED_BY) && !json.isNull(NEWANIMAL_MODIFIED_BY) ? json.getInt(NEWANIMAL_MODIFIED_BY): null);
@@ -269,9 +269,9 @@ public String createdDateToString()
269269

270270
public void setColony(Integer colony) { _colony = colony; }
271271

272-
public Integer getAnimalAccount() { return _animalAccount; }
272+
public String getAnimalAccount() { return _animalAccount; }
273273

274-
public void setAnimalAccount(Integer animalAccount) { _animalAccount = animalAccount; }
274+
public void setAnimalAccount(String animalAccount) { _animalAccount = animalAccount; }
275275

276276
public Integer getOwnerInstitution() { return _ownerInstitution; }
277277

@@ -297,9 +297,9 @@ public String createdDateToString()
297297

298298
public void setPedigree(Integer pedigree) { _pedigree = pedigree; }
299299

300-
public Integer getIacuc() { return _iacuc; }
300+
public String getIacuc() { return _iacuc; }
301301

302-
public void setIacuc(Integer iacuc) { _iacuc = iacuc; }
302+
public void setIacuc(String iacuc) { _iacuc = iacuc; }
303303

304304
public Date getCreated() { return _created; }
305305

0 commit comments

Comments
 (0)