Leave a comment at the end of this page or email contact@krishagni.com
Update Print Rule
openspecimen/rest/ng/specimen/print-rules/name={ruleName}
or
openspecimen/rest/ng/specimen/print-rules/{id}
Use this resource to update print rule in the openSpecimen application. Use HTTP PUT method to call this API by passing the below details in JSON format.
Below are the attributes which need to be sent in the request body:
Parameter | Definition |
---|---|
specimenClass[Optional] | Class of the specimen. By default it will be 'any' |
dataOnLabel | Information that needs to be included in the label based on the specimen class/type and label type |
workstationIP [Optional] | IP address of the machine from where the print request will come and this decides to which printer the request has to be forwarded to. By default it will be 'any' It can be specified in wild card format like grouping e.g all IPs starting with 128 will have same rule all IPs starting with 128.3. will have same rule |
ruleName | Name of the print rule. Should be unique in system |
printerName | Name of the printer where the request has to be forwarded to. |
labelType | This could be cap+slide or slide. This parameter and the specimen type define the information that needs to go in the label. This will help user to configure based on label physical dimensions. |
specimenType [Optional] | Type of the specimen . By default it will be 'any' |
loginName | Login name of user |
domainName | Domain name of user |
cpShortTitle | Collection protocol short title |
http[s]:<host>:<port>/openspecimen/rest/ng/specimen/print-rules/name={ruleName}
or
http[s]:<host>:<port>/openspecimen/rest/ng/specimen/print-rules/{id}
Use this URL to update print rule in openSpecimen application.
Result:
The response of this request will contains the details of the updated print rule.
Below is the example of the update print rule:
URL |
or openspecimen/rest/ng/specimen/print-rules/{ruleId} |
Method | PUT |
Request | application/json |
json | { "name":"My PrintRule", "specimenClass" : "fluid", "specimenType" : "any", "labelType" : "cap+slide", "dataOnLabel" : ["Specimen Label","Specimen type","CP title","Created On"], "printerName" : "TB2", "workstationIP" : "127.0.0.1" , "loginName" : {"loginName" : "admin@admin.com", "domainName" :"catissue"}, "cpShortTitle" : "SCS_CP" } |
Response | { id: 3 name: "My PrintRule" specimenClass: "fluid" specimenType: "any" labelType: "cap+slide" workstationIP: "127.0.0.1" dataOnLabel: [2] 0: "Specimen type" 1: "Specimen Label" printerName: "TB2" cpShortTitle: "SCS_CP" } |
Error Cases :
code | Applies to | Status Message |
---|---|---|
200 | All resources | Print rule has been updated successfully |
400 | All requests | Invalid parameters, e.g duplicate print rule name, blank print rule name etc |
401 | All requests | Authorization failed, user doesn’t have authority |
404 | All requests | Print rule not found, print rule with given details not present in the system |
500 | All requests | Internal server error, encountered server error while performing operations |
Leave a comment at the end of this page or email contact@krishagni.com