1 /**
  2  * @fileOverview
  3  * @author <a href="https://www.labkey.org">LabKey</a> (<a href="mailto:info@labkey.com">info@labkey.com</a>)
  4  * @license Copyright (c) 2012-2019 LabKey Corporation
  5  * <p/>
  6  * Licensed under the Apache License, Version 2.0 (the "License");
  7  * you may not use this file except in compliance with the License.
  8  * You may obtain a copy of the License at
  9  * <p/>
 10  * http://www.apache.org/licenses/LICENSE-2.0
 11  * <p/>
 12  * Unless required by applicable law or agreed to in writing, software
 13  * distributed under the License is distributed on an "AS IS" BASIS,
 14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  * See the License for the specific language governing permissions and
 16  * limitations under the License.
 17  * <p/>
 18  */
 19 
 20 /**
 21  * @namespace Specimen static class to retrieve and update specimen and specimen request information.
 22  *            <p>Additional Documentation:
 23  *              <ul>
 24  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
 25  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=specimens">Specimen User Guide</a></li>
 26  *              </ul>
 27  *           </p>
 28  */
 29 LABKEY.Specimen = new function()
 30 {
 31     function getSuccessCallbackWrapper(successCallback, rootProperty)
 32     {
 33         return LABKEY.Utils.getCallbackWrapper(function(data){
 34             successCallback(rootProperty ? data[rootProperty] : data);
 35         }, this);
 36     }
 37 
 38     function sendJsonQueryRequest(config) {
 39         LABKEY.Ajax.request({
 40             url : config.url,
 41             method : config.method || 'POST',
 42             success : config.success,
 43             failure : config.failure,
 44             jsonData : config.jsonData,
 45             headers : {
 46                 'Content-Type' : 'application/json'
 47             }
 48         });
 49     }
 50 
 51     /** @scope LABKEY.Specimen */
 52     return {
 53         /**
 54          * Retrieves an array of locations that are identified as specimen repositories.
 55          * @param {Object} config An object which contains the following configuration properties.
 56          * @param {Function} config.success Required. Function called when the
 57          "getAll" function executes successfully.  Will be called with the argument:
 58          {@link LABKEY.Specimen.Location[]}.
 59          * @param {Function} [config.failure] Function called when execution of the "getRespositories" function fails.
 60          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
 61          *       If not supplied, the current container path will be used.
 62          * Retrieves an array of all locations identified as repositories within the specified study.
 63          */
 64         getRepositories : function(config)
 65         {
 66             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
 67                 config = {
 68                     success : arguments[0],
 69                     failure : arguments[1],
 70                     containerPath : arguments[2]
 71                 };
 72             }
 73 
 74             sendJsonQueryRequest({
 75                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getRespositories", config.containerPath),
 76                 success : getSuccessCallbackWrapper(config.success, 'repositories'),
 77                 failure : LABKEY.Utils.getCallbackWrapper(config.failure || LABKEY.Utils.displayAjaxErrorResponse, this, true)
 78             });
 79         },
 80 
 81         // GetVialsByRowIdAction
 82         /**
 83          * Retrieves an array of vials that correspond to an array of unique vial row ids.
 84          * @param {Object} config An object which contains the following configuration properties.
 85          * @param {Function} config.success Required. Function called when the
 86          "getVialsByRowId" function executes successfully.  Will be called with the argument:
 87          {@link LABKEY.Specimen.Vial[]}.
 88          * @param {Function} config.vialRowIdArray An array of integer vial row IDs.
 89          * @param {Function} [config.failure] Function called when execution of the "getVialsByRowId" function fails.
 90          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
 91          *       If not supplied, the current container path will be used.
 92          * Retrieves an array of all locations identified as repositories within the specified study.
 93          */
 94         getVialsByRowId : function(config)
 95         {
 96             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
 97                 config = {
 98                     success : arguments[0],
 99                     vialRowIdArray : arguments[1],
100                     failure : arguments[2],
101                     containerPath : arguments[3]
102                 };
103             }
104 
105             sendJsonQueryRequest({
106                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getVialsByRowId", config.containerPath),
107                 success : getSuccessCallbackWrapper(config.success, 'vials'),
108                 failure: LABKEY.Utils.getCallbackWrapper(config.failure || LABKEY.Utils.displayAjaxErrorResponse, this, true),
109                 jsonData : { rowIds : config.vialRowIdArray }
110             });
111         },
112 
113         // GetOpenRequestsAction
114         /**
115          * Retrieves an array of open (non-final) specimen requests, including all requests that are in "shopping cart"
116          * status as well as those that have been submitted for processing but are not yet complete.
117          * @param {Object} config An object which contains the following configuration properties.
118          * @param {Function} config.success Required. Function called when the
119          "getOpenRequests" function executes successfully.  Will be called with the argument:
120          {@link LABKEY.Specimen.Request[]}.
121          * @param {Boolean} [config.allUsers] Indicates whether to retrieve open requests for all users, rather than just those created
122          * by the current user.  If not supplied, requests will be returned based on the user's permission.  Administrators will
123          * see all open requests, while non-admin users will only see those requests that they have created.
124          * @param {Function} [config.failure] Function called when execution of the "getOpenRequests" function fails.
125          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
126          *       If not supplied, the current container path will be used.
127          * Retrieves an array of open requests within the specified study.
128          */
129         getOpenRequests : function(config)
130         {
131             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
132                 config = {
133                     success : arguments[0],
134                     allUsers: arguments[1],
135                     failure : arguments[2],
136                     containerPath : arguments[3]
137                 };
138             }
139 
140             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
141             // default callback and callback wrapper functions:
142             if (!config.failure)
143                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
144 
145             sendJsonQueryRequest({
146                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getOpenRequests", config.containerPath),
147                 success : getSuccessCallbackWrapper(config.success, 'requests'),
148                 failure : LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
149                 jsonData : { allUsers: config.allUsers }
150             });
151         },
152 
153         // GetProvidingLocationsAction
154         /**
155          * Retrieves an array of locations that could provide vials from all identified primary specimens.
156          * @param {Object} config An object which contains the following configuration properties.
157          * @param {Function} config.success Required. Function called when the
158          "getProvidingLocations" function executes successfully.  Will be called with the argument:
159          {@link LABKEY.Specimen.Location[]}..
160          * @param {String[]} config.specimenHashArray An array of hash codes identifying the primary specimens to be provided.
161          * @param {Function} [config.failure] Function called when execution of the "getProvidingLocations" function fails.
162          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
163          *       If not supplied, the current container path will be used.
164          */
165         getProvidingLocations : function(config)
166         {
167             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
168                 config = {
169                     success : arguments[0],
170                     specimenHashArray : arguments[1],
171                     failure : arguments[2],
172                     containerPath : arguments[3]
173                 };
174             }
175 
176             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
177             // default callback and callback wrapper functions:
178             if (!config.failure)
179                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
180 
181             sendJsonQueryRequest({
182                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getProvidingLocations", config.containerPath),
183                 success : getSuccessCallbackWrapper(config.success, 'locations'),
184                 failure : LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
185                 jsonData: { specimenHashes : config.specimenHashArray }
186             });
187         },
188 
189         // GetVialTypeSummaryAction
190         /**
191          * Retrieves a specimen request for a given specimen request ID.
192          * @param {Object} config An object which contains the following configuration properties.
193          * @param {Function} config.success Required. Function called when the
194          *        "getVialTypeSummary" function executes successfully.  Will be called with a single argument with the following top-level properties:
195          * <ul>
196          *  <li>primaryTypes</li>
197          *  <li>derivativeTypes</li>
198          *  <li>additiveTypes</li>
199          * </ul>
200          *
201          * The value of each of these properties is an array of objects with four properties:
202          * <ul>
203          *  <li>label: the text label of the specimen type.</li>
204          *  <li>count: the number of vials of this type.  This count will reflect any parent types as well (see 'children' below).</li>
205          *  <li>url: the URL that can be used to access the list of these vials.</li>
206          *  <li>children: an array of sub-types.  May be undefined if no child types are available.  If present, each child array element has the same properties described in this list.</li>
207          * </ul>
208          * @param {Function} [config.failure] Function called when execution of the "getOpenRequests" function fails.
209          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
210          *       If not supplied, the current container path will be used.
211          */
212         getVialTypeSummary : function(config)
213         {
214             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
215             // default callback and callback wrapper functions:
216             if (!config.failure)
217                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
218 
219             sendJsonQueryRequest({
220                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getVialTypeSummary", config.containerPath),
221                 success: getSuccessCallbackWrapper(config.success),
222                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true)
223             });
224         },
225 
226         // GetSpecimenWebPartGroupsAction
227         /**
228          * Retrieves a specimen request for a given specimen request ID.
229          * @param {Object} config An object which contains the following configuration properties.
230          * @param {Function} config.success Required. Function called when the
231          *        "getSpecimenWebPartGroups" function executes successfully.  Will be called with a single argument with the following top-level properties:
232          * <ul>
233          *  <li>groupings: [group...]</li>
234          * </ul>
235          * The value of this property is an array of group objects, each with two properties:
236          *  <li>name: the text label of the column.</li>
237          *  <li>values: the value of this property is an array ofobjects with four properties:
238          * <ul>
239          *  <li>label: the text label of the specimen type.</li>
240          *  <li>count: the number of vials of this type.  This count will reflect any parent types as well (see 'children' below).</li>
241          *  <li>url: the URL that can be used to access the list of these vials.</li>
242          *  <li>group: an optional sub-group.</li>
243          * </ul>
244          * @param {Function} [config.failure] Function called when execution of the "getOpenRequests" function fails.
245          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
246          *       If not supplied, the current container path will be used.
247          */
248         getSpecimenWebPartGroups : function(config)
249         {
250             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
251             // default callback and callback wrapper functions:
252             if (!config.failure)
253                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
254 
255             sendJsonQueryRequest({
256                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getSpecimenWebPartGroups", config.containerPath),
257                 success: getSuccessCallbackWrapper(config.success),
258                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true)
259             });
260         },
261 
262         // GetRequestAction
263         /**
264          * Retrieves a specimen request for a given specimen request ID.
265          * @param {Object} config An object which contains the following configuration properties.
266          * @param {Function} config.success Required. Function called when the
267          "getRequest" function executes successfully.  Will be called with the argument:
268          {@link LABKEY.Specimen.Request}.
269          * @param {int} config.requestId The integer ID of the desired specimen request
270          * @param {Function} [config.failure] Function called when execution of the "getOpenRequests" function fails.
271          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
272          *       If not supplied, the current container path will be used.
273          */
274         getRequest : function(config)
275         {
276             if (config && LABKEY.Utils.isFunction(config) || arguments.length > 1){
277                 config = {
278                     success : arguments[0],
279                     requestId : arguments[1],
280                     failure : arguments[2],
281                     containerPath : arguments[3]
282                 };
283             }
284 
285             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
286             // default callback and callback wrapper functions:
287             if (!config.failure)
288                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
289 
290             sendJsonQueryRequest({
291                 url : LABKEY.ActionURL.buildURL("study-samples-api", "getRequest", config.containerPath),
292                 success: getSuccessCallbackWrapper(config.success, 'request'),
293                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
294                 jsonData : { requestId: config.requestId }
295             });
296         },
297 
298         // DeleteRequestAction
299         /**
300          * Completely and permanently cancels a request.  THIS ACTION CANNOT BE UNDONE.
301          * If called by a non-administrator, the target request must be owned by the
302          * calling user, and the request must be in an open (not yet submitted) state.  Administrators may delete
303          * requests at any time.
304          * @param {Object} config An object which contains the following configuration properties.
305          * @param {Function} config.success Required. Function called when the
306          "addVialToRequest" function executes successfully.  No arguments are provided.
307          * @param {int} config.requestId The unique integer identifier of the target request.
308          * @param {Function} [config.failure] Function called when execution of the "addVialToRequest" function fails.
309          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
310          *       If not supplied, the current container path will be used.
311          */
312         cancelRequest : function(config)
313         {
314             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
315                 config = {
316                     success : arguments[0],
317                     requestId : arguments[1],
318                     failure : arguments[2],
319                     containerPath : arguments[3]
320                 }
321             }
322 
323             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
324             // default callback and callback wrapper functions:
325             if (!config.failure)
326                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
327 
328             sendJsonQueryRequest({
329                 url : LABKEY.ActionURL.buildURL("study-samples-api", "cancelRequest", config.containerPath),
330                 method : 'POST',
331                 success: getSuccessCallbackWrapper(config.success),
332                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
333                 jsonData : {requestId : config.requestId }
334             });
335         },
336 
337         // AddVialToRequestAction
338         /**
339          * Adds multiple vials to a request based on an array of unique unique vial IDs.  If called by a non-administrator,
340          * the target request must be owned by the calling user, and the request must be in an open (not yet submitted)
341          * state.  Administrators may add vials to any request at any time.
342          * @param {Object} config An object which contains the following configuration properties.
343          * @param {Function} config.success Required. Function called when the
344          "addVialToRequest" function executes successfully.  Will be called with a single argument
345          {@link LABKEY.Specimen.Request}, containing the newly modified request.
346          * @param {int} config.requestId The unique integer identifier of the target request.
347          * @param {Array} config.vialIdArray An array of global unique vial IDs to add to the target request.
348          * @param {String} [config.idType] A string constant indicating how vials are identified.  This must be either
349          * "GlobalUniqueId" or "RowId".  If undefined, "GlobalUniqueId" is assumed.
350          * @param {Function} [config.failure] Function called when execution of the "addVialToRequest" function fails.
351          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
352          *       If not supplied, the current container path will be used.
353          */
354         addVialsToRequest : function(config)
355         {
356             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
357                 config = {
358                     success : arguments[0],
359                     requestId : arguments[1],
360                     vialIdArray: arguments[2],
361                     idType : arguments[3],
362                     failure: arguments[4],
363                     containerPath: arguments[5]
364                 };
365             }
366 
367             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
368             // default callback and callback wrapper functions:
369             if (!config.failure)
370                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
371             if (!config.idType)
372                 config.idType = "GlobalUniqueId";
373 
374             sendJsonQueryRequest({
375                 url : LABKEY.ActionURL.buildURL("study-samples-api", "addVialsToRequest", config.containerPath),
376                 success: getSuccessCallbackWrapper(config.success),
377                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
378                 jsonData : {requestId : config.requestId, vialIds : config.vialIdArray, idType: config.idType}
379             });
380         },
381 
382         // AddSampleToRequestAction
383         /**
384          * Adds multiple vials to a request based on an array of hash codes uniquely identifying the primary specimens.  The vials will
385          * be selected based on availability and current location.  If called by a non-administrator, the target request must be owned by the
386          * calling user, and the request must be in an open (not yet submitted) state.  Administrators may add vials
387          * to any request at any time.
388          * @param {Object} config An object which contains the following configuration properties.
389          * @param {Function} config.success Required. Function called when the
390          "addSampleToRequest" function executes successfully.  Will be called with a single argument
391          {@link LABKEY.Specimen.Request}, containing the newly modified request.
392          * @param {int} config.requestId The unique integer identifier of the target request.
393          * @param {String[]} config.specimenHashArray An array of hash codes identifying the primary specimens to add to the target request.
394          * @param {int} config.preferredLocation The unique ID of the preferred providing location.  If more than on providing location is possible,
395          * and if the request does not already contain vials uniquely identifying one of these providing locations, this
396          * parameter must be provided.
397          * @param {Function} [config.failure] Function called when execution of the "addSampleToRequest" function fails.
398          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
399          *       If not supplied, the current container path will be used.
400          */
401         addSamplesToRequest : function(config)
402         {
403             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
404                 config = {
405                     success : arguments[0],
406                     requestId : arguments[1],
407                     specimenHashArray : arguments[2],
408                     preferredLocation : arguments[3],
409                     failure : arguments[4],
410                     containerPath : arguments[5]
411                 };
412             }
413 
414             var failure = LABKEY.Utils.getOnFailure(config);
415             var success = LABKEY.Utils.getOnSuccess(config);
416             
417             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
418             // default callback and callback wrapper functions:
419             if (!failure)
420                 failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
421 
422             sendJsonQueryRequest({
423                 url : LABKEY.ActionURL.buildURL("study-samples-api", "addSamplesToRequest", config.containerPath),
424                 method : 'POST',
425                 success: getSuccessCallbackWrapper(success),
426                 failure: LABKEY.Utils.getCallbackWrapper(failure, this, true),
427                 jsonData : {
428                     requestId : config.requestId,
429                     specimenHashes : config.specimenHashArray,
430                     preferredLocation : config.preferredLocation
431                 }
432             });
433         },
434 
435 
436         // RemoveVialFromRequestAction
437         /**
438          * Removes multiple vials from a request based on an array of vial row IDs.  If called by a non-administrator,
439          * the target request must be owned by the calling user, and the request must be in an open (not yet submitted)
440          * state.  Administrators may remove vials from any request at any time.
441          * @param {Object} config An object which contains the following configuration properties.
442          * @param {Function} config.success Required. Function called when the
443          "removeVialFromRequest" function executes successfully.  Will be called with a single argument
444          {@link LABKEY.Specimen.Request}, containing the newly modified request.
445          * @param {int} config.requestId The unique integer identifier of the target request.
446          * @param {String[]} config.vialIdArray An array of global unique vial IDs to remove from the target request.
447          * @param {String} [config.idType] A string constant indicating how vials are identified.  This must be either
448          * "GlobalUniqueId" or "RowId".  If undefined, "GlobalUniqueId" is assumed.
449          * @param {Function} [config.failure] Function called when execution of the "removeVialFromRequest" function fails.
450          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
451          *       If not supplied, the current container path will be used.
452          */
453         removeVialsFromRequest : function(config)
454         {
455             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
456                 config = {
457                     success : arguments[0],
458                     requestId : arguments[1],
459                     vialIdArray : arguments[2],
460                     idType : arguments[3],
461                     failure : arguments[4],
462                     containerPath : arguments[5]
463                 };
464             }
465 
466             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
467             // default callback and callback wrapper functions:
468             if (!config.failure)
469                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
470             if (!config.idType)
471                 config.idType = "GlobalUniqueId";
472 
473             sendJsonQueryRequest({
474                 url : LABKEY.ActionURL.buildURL("study-samples-api", "removeVialsFromRequest", config.containerPath),
475                 method: 'POST',
476                 success: getSuccessCallbackWrapper(config.success),
477                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
478                 jsonData : {requestId : config.requestId, vialIds : config.vialIdArray, idType : config.idType}
479             });
480         }
481     };
482 };
483 
484 /**
485  * @name LABKEY.Specimen.Location
486  * @class   Location class to describe the shape and fields of a specimen location.
487  *            <p>Additional Documentation:
488  *              <ul>
489  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
490  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=specimens">Specimen User Guide</a></li>
491  *              </ul>
492  *           </p>
493  */
494 
495 /**#@+
496  * @memberOf LABKEY.Specimen.Location#
497  * @field
498  */
499 
500 /**
501  * @name    endpoint
502  * @description   Whether this location is an endpoint lab.  May be null if unspecified.
503  * @type       Boolean
504  */
505 
506 /**
507  * @name        entityId
508  * @description    An entity Id uniquely identifying this location.
509  * @type        String
510  */
511 
512 /**
513  * @name        label
514  * @description   The display name for this location.
515  * @type        String
516  */
517 
518 /**
519  * @name          labUploadCode
520  * @description    The location upload code. May be null if unspecified.
521  * @type      String
522  */
523 
524 /**
525  * @name    labwareLabCode
526  * @description    The labware location code. May be null if unspecified.
527  * @type       String
528  */
529 
530 /**
531  * @name       ldmsLabCode
532  * @description    The LDMS location code. May be null if unspecified.
533  * @type         String
534  */
535 
536 /**
537  * @name        repository
538  * @description  Whether this location is a repository. May be null if unspecified.
539  * @type       Boolean
540  */
541 
542 /**
543  * @name      LABKEY.Specimen.Location#rowId
544  * @description   An integer uniquely identifying this location.
545  * @type   Integer
546  */
547 
548 /**
549  * @name   SAL
550  * @description  Whether this location is a Site Affiliated Laboratory.  May be null if unspecified.
551  * @type     Boolean
552  */
553 
554 /**
555  * @name   clinic
556  * @description  Whether this location is a clinic.  May be null if unspecified.
557  * @type    Boolean
558  */
559 
560 /**
561  * @name     externalId
562  * @description  The unique identifier for locations imported from an external database of record.  May be null.
563  * @type    Integer
564  */
565 
566 /**#@-*/
567 
568 /**
569  * @name LABKEY.Specimen.Request
570  * @class   Request class to describe the shape and fields of a specimen request.
571  *            <p>Additional Documentation:
572  *              <ul>
573  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
574  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=specimens">Specimen User Guide</a></li>
575  *              </ul>
576  *           </p>
577  * @see LABKEY.Specimen.Location
578  * @see LABKEY.Specimen.Vial
579  */
580 
581 /**#@+
582  * @memberOf LABKEY.Specimen.Request#
583  * @field
584  */
585 
586 /**
587  * @name      requestId
588  * @description   The unique ID for this request.
589  * @type            Integer
590  */
591 
592 /**
593  * @name      comments
594  * @description    All comments associated with this request.
595  * @type       String
596  */
597 
598 /**
599  * @name            created
600  * @description   The date and time that this request was created.
601  * @type        Date
602  */
603 
604 /**
605  * @name  createdBy
606  * @description  An object describing the user that created this request.  This object has two properties:
607  *          <ul>
608  *              <li><b>userId:</b> The user's ID</li>
609  *              <li><b>displayName:</b> The user's display name</li>
610  *          </ul>
611  * @type      Object
612  */
613 
614 /**
615  * @name         destination
616  * @description   Indicates which location that will receive the requested vials.
617  * @type         LABKEY.Specimen.Location
618  */
619 
620 /**
621  * @name       statusId
622  * @description   The unique identifier of the request's current status.
623  * @type        Integer
624  */
625 
626 /**
627  * @name          status
628  * @description   The string label of the request's current status.
629  * @type      String
630  */
631 
632 /**
633  * @name  vials
634  * @description  An array of objects of type {@link LABKEY.Specimen.Vial}, indicating which vials are part of this request.
635  * @type     Object
636  */
637 
638 /**#@-*/
639 
640 
641 
642 /**
643  * @name LABKEY.Specimen.Vial
644  * @class  Vial class to describe the shape and fields of a specimen vial.
645  *            <p>Additional Documentation:
646  *              <ul>
647  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
648  *                  <li><a href="https://www.labkey.org/Documentation/wiki-page.view?name=specimens">Specimen User Guide</a></li>
649  *              </ul>
650  *           </p>
651  * @see LABKEY.Specimen.Location
652  */
653 
654 /**#@+
655  * @memberOf LABKEY.Specimen.Vial#
656  * @field
657  */
658 
659 /**
660  * @name  globalUniqueId
661  * @description  The global unique ID of this vial
662  * @type  String
663  */
664 
665 /**
666  * @name rowId
667  * @description  The unique database Row ID of this vial
668  * @type Integer
669  */
670 
671 /**
672  * @name ptid
673  * @description  The ID of the participant providing this vial.
674  * @type String
675  */
676 
677 /**
678  * @name visitValue
679  * @description  The visit value at which this specimen was collected.
680  * @type Double
681  */
682 
683 /**
684  * @name primaryTypeId
685  * @description  The unique identifier of this vial's primary specimen type.
686  * @type Integer
687  */
688 
689 /**
690  * @name primaryType
691  * @description   The label of this vial's primary specimen type.
692  * @type  String
693  */
694 
695 /**
696  * @name        derivativeTypeId
697  * @description  The unique identifier of this vial's derivative type.
698  * @type      Integer
699  */
700 
701 /**
702  * @name  derivativeType
703  * @description   The label of this vial's derivative type.
704  * @type     String
705  */
706 
707 /**
708  * @name        additiveTypeId
709  * @description     The unique identifier of this vial's additive type.
710  * @type       Integer
711  */
712 
713 /**
714  * @name   additiveType
715  * @description   The label of this vial's additive type.
716  * @type      String
717  */
718 
719 /**
720  * @name currentLocation
721  * @description  A {@link LABKEY.Specimen.Location} object indicating this vial's current location.
722  * @type    LABKEY.Specimen.Location
723  */
724 
725 /**
726  * @name     originatingLocation
727  * @description   A {@link LABKEY.Specimen.Location} object indicating this vial's originating location.
728  * @type         LABKEY.Specimen.Location
729  */
730 
731 /**
732  * @name        subAdditiveDerivative
733  * @description    A label of this vial's sub-additive/derivative type.
734  * @type         String
735  */
736 
737 /**
738  * @name       specimenHash
739  * @description    A  hash code uniquely identifying this vial's ptid, visit, and type information.
740  *                 This value can be used to group vials into primary specimen draws.
741  * @type         String
742  */
743 
744 /**
745  * @name         volume
746  * @description    The volume of this vial.
747  * @type       Double
748  */
749 
750 /**
751  * @name      volumeUnits
752  * @description   The volume units for this vial.
753  * @type      String
754  */
755 
756 /**#@-*/