Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CTAs column to Patients table #88

Merged
merged 1 commit into from
Jan 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions migrations/20210113031337-add-ctas-column-to-patients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addColumn('patients', 'ctas', {
type: Sequelize.DataTypes.INTEGER,
});
},

down: (queryInterface) => {
return queryInterface.removeColumn('patients', 'ctas');
},
};
1 change: 1 addition & 0 deletions models/patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = (sequelize, DataTypes) => {
},
notes: DataTypes.TEXT,
transportTime: DataTypes.DATE,
ctas: DataTypes.INTEGER,
createdAt: DataTypes.DATE,
updatedAt: DataTypes.DATE,
},
Expand Down
2 changes: 2 additions & 0 deletions resolvers/patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const patientResolvers = {
transportTime: args.transportTime,
hospitalId: args.hospitalId,
ambulanceId: args.ambulanceId,
ctas: args.ctas,
});
const collectionPoint = await db.collectionPoint.findByPk(
newPatient.collectionPointId
Expand Down Expand Up @@ -136,6 +137,7 @@ const patientResolvers = {
{
gender: args.gender,
age: args.age,
ctas: args.ctas,
runNumber: args.runNumber,
barcodeValue: args.barcodeValue,
collectionPointId: args.collectionPointId,
Expand Down
3 changes: 3 additions & 0 deletions schema/patient.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const patientSchema = `
transportTime: DateTime,
hospitalId: ID,
ambulanceId: ID
ctas: Int
): Patient!

updatePatient(
Expand All @@ -55,6 +56,7 @@ const patientSchema = `
transportTime: DateTime,
hospitalId: ID,
ambulanceId: ID
ctas: Int
): Patient!

restorePatient(id: ID!): Patient!
Expand Down Expand Up @@ -85,6 +87,7 @@ const patientSchema = `
updatedAt: DateTime,
hospitalId: Hospital,
ambulanceId: Ambulance
ctas: Int
}
`;
exports.patientSchema = patientSchema;