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) 2009-2016 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/wiki/home/Documentation/page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
 25  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/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                 success: getSuccessCallbackWrapper(config.success),
331                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
332                 jsonData : {requestId : config.requestId }
333             });
334         },
335 
336         // AddVialToRequestAction
337         /**
338          * Adds multiple vials to a request based on an array of unique unique vial IDs.  If called by a non-administrator,
339          * the target request must be owned by the calling user, and the request must be in an open (not yet submitted)
340          * state.  Administrators may add vials to any request at any time.
341          * @param {Object} config An object which contains the following configuration properties.
342          * @param {Function} config.success Required. Function called when the
343          "addVialToRequest" function executes successfully.  Will be called with a single argument
344          {@link LABKEY.Specimen.Request}, containing the newly modified request.
345          * @param {int} config.requestId The unique integer identifier of the target request.
346          * @param {Array} config.vialIdArray An array of global unique vial IDs to add to the target request.
347          * @param {String} [config.idType] A string constant indicating how vials are identified.  This must be either
348          * "GlobalUniqueId" or "RowId".  If undefined, "GlobalUniqueId" is assumed.
349          * @param {Function} [config.failure] Function called when execution of the "addVialToRequest" function fails.
350          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
351          *       If not supplied, the current container path will be used.
352          */
353         addVialsToRequest : function(config)
354         {
355             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
356                 config = {
357                     success : arguments[0],
358                     requestId : arguments[1],
359                     vialIdArray: arguments[2],
360                     idType : arguments[3],
361                     failure: arguments[4],
362                     containerPath: arguments[5]
363                 };
364             }
365 
366             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
367             // default callback and callback wrapper functions:
368             if (!config.failure)
369                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
370             if (!config.idType)
371                 config.idType = "GlobalUniqueId";
372 
373             sendJsonQueryRequest({
374                 url : LABKEY.ActionURL.buildURL("study-samples-api", "addVialsToRequest", config.containerPath),
375                 success: getSuccessCallbackWrapper(config.success),
376                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
377                 jsonData : {requestId : config.requestId, vialIds : config.vialIdArray, idType: config.idType}
378             });
379         },
380 
381         // AddSampleToRequestAction
382         /**
383          * Adds multiple vials to a request based on an array of hash codes uniquely identifying the primary specimens.  The vials will
384          * be selected based on availability and current location.  If called by a non-administrator, the target request must be owned by the
385          * calling user, and the request must be in an open (not yet submitted) state.  Administrators may add vials
386          * to any request at any time.
387          * @param {Object} config An object which contains the following configuration properties.
388          * @param {Function} config.success Required. Function called when the
389          "addSampleToRequest" function executes successfully.  Will be called with a single argument
390          {@link LABKEY.Specimen.Request}, containing the newly modified request.
391          * @param {int} config.requestId The unique integer identifier of the target request.
392          * @param {String[]} config.specimenHashArray An array of hash codes identifying the primary specimens to add to the target request.
393          * @param {int} config.preferredLocation The unique ID of the preferred providing location.  If more than on providing location is possible,
394          * and if the request does not already contain vials uniquely identifying one of these providing locations, this
395          * parameter must be provided.
396          * @param {Function} [config.failure] Function called when execution of the "addSampleToRequest" function fails.
397          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
398          *       If not supplied, the current container path will be used.
399          */
400         addSamplesToRequest : function(config)
401         {
402             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
403                 config = {
404                     success : arguments[0],
405                     requestId : arguments[1],
406                     specimenHashArray : arguments[2],
407                     preferredLocation : arguments[3],
408                     failure : arguments[4],
409                     containerPath : arguments[5]
410                 };
411             }
412 
413             var failure = LABKEY.Utils.getOnFailure(config);
414             var success = LABKEY.Utils.getOnSuccess(config);
415             
416             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
417             // default callback and callback wrapper functions:
418             if (!failure)
419                 failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
420 
421             sendJsonQueryRequest({
422                 url : LABKEY.ActionURL.buildURL("study-samples-api", "addSamplesToRequest", config.containerPath),
423                 success: getSuccessCallbackWrapper(success),
424                 failure: LABKEY.Utils.getCallbackWrapper(failure, this, true),
425                 jsonData : {
426                     requestId : config.requestId,
427                     specimenHashes : config.specimenHashArray,
428                     preferredLocation : config.preferredLocation
429                 }
430             });
431         },
432 
433 
434         // RemoveVialFromRequestAction
435         /**
436          * Removes multiple vials from a request based on an array of vial row IDs.  If called by a non-administrator,
437          * the target request must be owned by the calling user, and the request must be in an open (not yet submitted)
438          * state.  Administrators may remove vials from any request at any time.
439          * @param {Object} config An object which contains the following configuration properties.
440          * @param {Function} config.success Required. Function called when the
441          "removeVialFromRequest" function executes successfully.  Will be called with a single argument
442          {@link LABKEY.Specimen.Request}, containing the newly modified request.
443          * @param {int} config.requestId The unique integer identifier of the target request.
444          * @param {String[]} config.vialIdArray An array of global unique vial IDs to remove from the target request.
445          * @param {String} [config.idType] A string constant indicating how vials are identified.  This must be either
446          * "GlobalUniqueId" or "RowId".  If undefined, "GlobalUniqueId" is assumed.
447          * @param {Function} [config.failure] Function called when execution of the "removeVialFromRequest" function fails.
448          * @param {String} [config.containerPath] The container path in which the relevant study is defined.
449          *       If not supplied, the current container path will be used.
450          */
451         removeVialsFromRequest : function(config)
452         {
453             if (config && (LABKEY.Utils.isFunction(config) || arguments.length > 1)){
454                 config = {
455                     success : arguments[0],
456                     requestId : arguments[1],
457                     vialIdArray : arguments[2],
458                     idType : arguments[3],
459                     failure : arguments[4],
460                     containerPath : arguments[5]
461                 };
462             }
463 
464             // Unfortunately, we need to reverse our parameter order here- LABKEY.Utils uses inconsistent ordering for its
465             // default callback and callback wrapper functions:
466             if (!config.failure)
467                 config.failure = function(error, response) { return LABKEY.Utils.displayAjaxErrorResponse(response, error); };
468             if (!config.idType)
469                 config.idType = "GlobalUniqueId";
470 
471             sendJsonQueryRequest({
472                 url : LABKEY.ActionURL.buildURL("study-samples-api", "removeVialsFromRequest", config.containerPath),
473                 success: getSuccessCallbackWrapper(config.success),
474                 failure: LABKEY.Utils.getCallbackWrapper(config.failure, this, true),
475                 jsonData : {requestId : config.requestId, vialIds : config.vialIdArray, idType : config.idType}
476             });
477         }
478     };
479 };
480 
481 /**
482  * @name LABKEY.Specimen.Location
483  * @class   Location class to describe the shape and fields of a specimen location.
484  *            <p>Additional Documentation:
485  *              <ul>
486  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
487  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=specimens">Specimen User Guide</a></li>
488  *              </ul>
489  *           </p>
490  */
491 
492 /**#@+
493  * @memberOf LABKEY.Specimen.Location#
494  * @field
495  */
496 
497 /**
498  * @name    endpoint
499  * @description   Whether this location is an endpoint lab.  May be null if unspecified.
500  * @type       Boolean
501  */
502 
503 /**
504  * @name        entityId
505  * @description    An entity Id uniquely identifying this location.
506  * @type        String
507  */
508 
509 /**
510  * @name        label
511  * @description   The display name for this location.
512  * @type        String
513  */
514 
515 /**
516  * @name          labUploadCode
517  * @description    The location upload code. May be null if unspecified.
518  * @type      String
519  */
520 
521 /**
522  * @name    labwareLabCode
523  * @description    The labware location code. May be null if unspecified.
524  * @type       String
525  */
526 
527 /**
528  * @name       ldmsLabCode
529  * @description    The LDMS location code. May be null if unspecified.
530  * @type         String
531  */
532 
533 /**
534  * @name        repository
535  * @description  Whether this location is a repository. May be null if unspecified.
536  * @type       Boolean
537  */
538 
539 /**
540  * @name      LABKEY.Specimen.Location#rowId
541  * @description   An integer uniquely identifying this location.
542  * @type   Integer
543  */
544 
545 /**
546  * @name   SAL
547  * @description  Whether this location is a Site Affiliated Laboratory.  May be null if unspecified.
548  * @type     Boolean
549  */
550 
551 /**
552  * @name   clinic
553  * @description  Whether this location is a clinic.  May be null if unspecified.
554  * @type    Boolean
555  */
556 
557 /**
558  * @name     externalId
559  * @description  The unique identifier for locations imported from an external database of record.  May be null.
560  * @type    Integer
561  */
562 
563 /**#@-*/
564 
565 /**
566  * @name LABKEY.Specimen.Request
567  * @class   Request class to describe the shape and fields of a specimen request.
568  *            <p>Additional Documentation:
569  *              <ul>
570  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
571  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=specimens">Specimen User Guide</a></li>
572  *              </ul>
573  *           </p>
574  * @see LABKEY.Specimen.Location
575  * @see LABKEY.Specimen.Vial
576  */
577 
578 /**#@+
579  * @memberOf LABKEY.Specimen.Request#
580  * @field
581  */
582 
583 /**
584  * @name      requestId
585  * @description   The unique ID for this request.
586  * @type            Integer
587  */
588 
589 /**
590  * @name      comments
591  * @description    All comments associated with this request.
592  * @type       String
593  */
594 
595 /**
596  * @name            created
597  * @description   The date and time that this request was created.
598  * @type        Date
599  */
600 
601 /**
602  * @name  createdBy
603  * @description  An object describing the user that created this request.  This object has two properties:
604  *          <ul>
605  *              <li><b>userId:</b> The user's ID</li>
606  *              <li><b>displayName:</b> The user's display name</li>
607  *          </ul>
608  * @type      Object
609  */
610 
611 /**
612  * @name         destination
613  * @description   Indicates which location that will receive the requested vials.
614  * @type         LABKEY.Specimen.Location
615  */
616 
617 /**
618  * @name       statusId
619  * @description   The unique identifier of the request's current status.
620  * @type        Integer
621  */
622 
623 /**
624  * @name          status
625  * @description   The string label of the request's current status.
626  * @type      String
627  */
628 
629 /**
630  * @name  vials
631  * @description  An array of objects of type {@link LABKEY.Specimen.Vial}, indicating which vials are part of this request.
632  * @type     Object
633  */
634 
635 /**#@-*/
636 
637 
638 
639 /**
640  * @name LABKEY.Specimen.Vial
641  * @class  Vial class to describe the shape and fields of a specimen vial.
642  *            <p>Additional Documentation:
643  *              <ul>
644  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=manageSpecimens">Specimen Management for Administrators</a></li>
645  *                  <li><a href="https://www.labkey.org/wiki/home/Documentation/page.view?name=specimens">Specimen User Guide</a></li>
646  *              </ul>
647  *           </p>
648  * @see LABKEY.Specimen.Location
649  */
650 
651 /**#@+
652  * @memberOf LABKEY.Specimen.Vial#
653  * @field
654  */
655 
656 /**
657  * @name  globalUniqueId
658  * @description  The global unique ID of this vial
659  * @type  String
660  */
661 
662 /**
663  * @name rowId
664  * @description  The unique database Row ID of this vial
665  * @type Integer
666  */
667 
668 /**
669  * @name ptid
670  * @description  The ID of the participant providing this vial.
671  * @type String
672  */
673 
674 /**
675  * @name visitValue
676  * @description  The visit value at which this specimen was collected.
677  * @type Double
678  */
679 
680 /**
681  * @name primaryTypeId
682  * @description  The unique identifier of this vial's primary specimen type.
683  * @type Integer
684  */
685 
686 /**
687  * @name primaryType
688  * @description   The label of this vial's primary specimen type.
689  * @type  String
690  */
691 
692 /**
693  * @name        derivativeTypeId
694  * @description  The unique identifier of this vial's derivative type.
695  * @type      Integer
696  */
697 
698 /**
699  * @name  derivativeType
700  * @description   The label of this vial's derivative type.
701  * @type     String
702  */
703 
704 /**
705  * @name        additiveTypeId
706  * @description     The unique identifier of this vial's additive type.
707  * @type       Integer
708  */
709 
710 /**
711  * @name   additiveType
712  * @description   The label of this vial's additive type.
713  * @type      String
714  */
715 
716 /**
717  * @name currentLocation
718  * @description  A {@link LABKEY.Specimen.Location} object indicating this vial's current location.
719  * @type    LABKEY.Specimen.Location
720  */
721 
722 /**
723  * @name     originatingLocation
724  * @description   A {@link LABKEY.Specimen.Location} object indicating this vial's originating location.
725  * @type         LABKEY.Specimen.Location
726  */
727 
728 /**
729  * @name        subAdditiveDerivative
730  * @description    A label of this vial's sub-additive/derivative type.
731  * @type         String
732  */
733 
734 /**
735  * @name       specimenHash
736  * @description    A  hash code uniquely identifying this vial's ptid, visit, and type information.
737  *                 This value can be used to group vials into primary specimen draws.
738  * @type         String
739  */
740 
741 /**
742  * @name         volume
743  * @description    The volume of this vial.
744  * @type       Double
745  */
746 
747 /**
748  * @name      volumeUnits
749  * @description   The volume units for this vial.
750  * @type      String
751  */
752 
753 /**#@-*/