1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
/*
Copyright (C) 1993, 1994, RSNA and Washington University
The software and supporting documentation for the Radiological
Society of North America (RSNA) 1993, 1994 Digital Imaging and
Communications in Medicine (DICOM) Demonstration were developed
at the
Electronic Radiology Laboratory
Mallinckrodt Institute of Radiology
Washington University School of Medicine
510 S. Kingshighway Blvd.
St. Louis, MO 63110
as part of the 1993, 1994 DICOM Central Test Node project for, and
under contract with, the Radiological Society of North America.
THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR
WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
THE SOFTWARE IS WITH THE USER.
Copyright of the software and supporting documentation is
jointly owned by RSNA and Washington University, and free access
is hereby granted as a license to use this software, copy this
software and prepare derivative works based upon this software.
However, any distribution of this software source code or
supporting documentation or derivative works (source code and
supporting documentation) must include the three paragraphs of
the copyright notice.
*/
/* Copyright marker. Copyright will be inserted above. Do not remove */
/*
** DICOM 93
** Electronic Radiology Laboratory
** Mallinckrodt Institute of Radiology
** Washington University School of Medicine
**
** Module Name(s): dblstseries (main())
** printseries
** Author, Date: David E. Beecher, 4-Jul-93
** Intent: List the series in a DICOM database
** Last Update: $Author: smm $, $Date: 1994-12-30 18:22:20 $
** Source File: $RCSfile: dblstseries.c,v $
** Revision: $Revision: 1.7 $
** Status: $State: Exp $
*/
static char rcsid[] = "$Revision: 1.7 $ $RCSfile: dblstseries.c,v $";
#include <stdio.h>
#include "dicom.h"
#include "dbquery.h"
void printseries(SeriesLevel series, int i);
main(int argc, char *argv[])
{
CONDITION
ret;
int
i;
short
id;
SeriesLevel
series;
char
patid[50],
studyuid[50],
dbname[50];
if (argc != 4) {
printf("Usage %s PatID StudyUID dbname\n", argv[0]);
exit(0);
}
strcpy(patid, argv[1]);
strcpy(studyuid, argv[2]);
strcpy(dbname, argv[3]);
if (DB_Open(dbname, &id) == DB_NORMAL)
printf("DB_Open succeeded\n");
else {
printf("DB_Open failed\n");
exit(1);
}
i = 1;
if (DB_GetSeries(id, patid, studyuid, &series) == DB_NORMAL) {
printseries(series, i);
while (DB_GetNextSeries(id, &series) == DB_NORMAL) {
i++;
printseries(series, i);
}
}
if (DB_Close(id) == DB_NORMAL)
printf("DB_Close succeeded\n");
else
exit(0);
}
/* printseries
**
** Purpose:
** Dump the characteristics of the series record
**
** Parameter Dictionary:
** series Characteristics of the series record to be dumped
** i Series record number
**
** Return Values:
** None
**
** Notes:
**
** Algorithm:
** Description of the algorithm (optional) and any other notes.
*/
void
printseries(SeriesLevel series, int i)
{
printf("Series #%d\n", i);
printf(" Modality: %s\n", series.Modality);
printf(" Series Number: %s\n", series.SeriesNumber);
printf(" Series UID: %s\n", series.SeriesUID);
return;
}
|