fix(patient): new api for create print, provision only
This commit is contained in:
@ -71,23 +71,7 @@ export class CardPrintQueueController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
private static async handleCreate(req: Request, res: Response, type: CardPrintQueueType): Promise<Response> {
|
||||||
/*
|
|
||||||
#swagger.tags = ['CardPrintQueue']
|
|
||||||
#swagger.security = [{
|
|
||||||
"bearerAuth": []
|
|
||||||
}]
|
|
||||||
#swagger.requestBody = {
|
|
||||||
required: true,
|
|
||||||
content: {
|
|
||||||
"application/json": {
|
|
||||||
schema: {
|
|
||||||
$ref: "#/components/schemas/card_print_queue"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
mrn: Joi.string().max(256).allow("").optional().label("MRN"),
|
mrn: Joi.string().max(256).allow("").optional().label("MRN"),
|
||||||
@ -123,9 +107,7 @@ export class CardPrintQueueController {
|
|||||||
data.patient_id = param.patient_id || null;
|
data.patient_id = param.patient_id || null;
|
||||||
data.facility_code = param.facility_code || null;
|
data.facility_code = param.facility_code || null;
|
||||||
data.status = param.status || CardPrintQueueStatus.PENDING;
|
data.status = param.status || CardPrintQueueStatus.PENDING;
|
||||||
// data.type = CardPrintQueueType.PROVISION; //test
|
data.type = type;
|
||||||
data.type = CardPrintQueueType.PRINT_PROVISION; //test
|
|
||||||
// data.type = CardPrintQueueType.PRINT; //test
|
|
||||||
|
|
||||||
const authHeader = req.headers.authorization;
|
const authHeader = req.headers.authorization;
|
||||||
let rawToken = "";
|
let rawToken = "";
|
||||||
@ -148,6 +130,67 @@ export class CardPrintQueueController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['CardPrintQueue']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
|
#swagger.requestBody = {
|
||||||
|
required: true,
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: {
|
||||||
|
$ref: "#/components/schemas/card_print_queue"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return CardPrintQueueController.handleCreate(req, res, CardPrintQueueType.PRINT_PROVISION);
|
||||||
|
}
|
||||||
|
|
||||||
|
static async createProvision(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['CardPrintQueue']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
|
#swagger.requestBody = {
|
||||||
|
required: true,
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: {
|
||||||
|
$ref: "#/components/schemas/card_print_queue"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return CardPrintQueueController.handleCreate(req, res, CardPrintQueueType.PROVISION);
|
||||||
|
}
|
||||||
|
|
||||||
|
static async createPrint(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['CardPrintQueue']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
|
#swagger.requestBody = {
|
||||||
|
required: true,
|
||||||
|
content: {
|
||||||
|
"application/json": {
|
||||||
|
schema: {
|
||||||
|
$ref: "#/components/schemas/card_print_queue"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return CardPrintQueueController.handleCreate(req, res, CardPrintQueueType.PRINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['CardPrintQueue']
|
#swagger.tags = ['CardPrintQueue']
|
||||||
|
|||||||
@ -545,6 +545,8 @@ export class RoutePrivate {
|
|||||||
|
|
||||||
app.get("/api/card-print-queue/list", CardPrintQueueController.list);
|
app.get("/api/card-print-queue/list", CardPrintQueueController.list);
|
||||||
app.post("/api/card-print-queue/create", CardPrintQueueController.create);
|
app.post("/api/card-print-queue/create", CardPrintQueueController.create);
|
||||||
|
app.post("/api/card-print-queue/create/provision", CardPrintQueueController.createProvision);
|
||||||
|
app.post("/api/card-print-queue/create/print", CardPrintQueueController.createPrint);
|
||||||
app.get("/api/card-print-queue/detail/:id", CardPrintQueueController.detail);
|
app.get("/api/card-print-queue/detail/:id", CardPrintQueueController.detail);
|
||||||
|
|
||||||
app.get("/api/payment-method/list", PaymentMethodController.list);
|
app.get("/api/payment-method/list", PaymentMethodController.list);
|
||||||
|
|||||||
Reference in New Issue
Block a user