File: format.c

package info (click to toggle)
ctn 3.2.0~dfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 15,420 kB
  • sloc: ansic: 179,553; makefile: 7,002; java: 1,863; csh: 1,067; yacc: 523; sh: 424; cpp: 394; sql: 389; lex: 170
file content (35 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (9)
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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef GCCSUNOS
#include <stddef.h>
#endif

#include "dicom.h"
#include "lst.h"
#include "condition.h"
#include "query_interface.h"

void
formatPatient(PATIENT_QUERY_MODULE * patient, int index, char *buf)
{
    (void) sprintf(buf, "%-16s %-30s %-12s", patient->PatientID,
		   patient->PatientName, patient->BirthDate);
}
void
formatStudy(STUDY_QUERY_MODULE * study, int index, char *buf)
{
    int
        i;

    (void) sprintf(buf, "%-16s %-16s %-10s", study->AccessionNumber,
		   study->StudyID, study->StudyDate);

    strcat(buf, "   ");
    for (i = 0; i < (int) DIM_OF(study->SeriesModalities); i++) {
	if (strlen(study->SeriesModalities[i]) == 0)
	    break;
	strcat(buf, " ");
	strcat(buf, study->SeriesModalities[i]);
    }
}